summaryrefslogtreecommitdiffstats
path: root/blog
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2019-04-16 20:43:45 +0200
committerHarald Eilertsen <haraldei@anduin.net>2019-04-16 20:43:45 +0200
commitda6f6a43f456444f1d6b9d350c4babb20d589fd9 (patch)
tree3a71f499552bcb870aa53dbca4158cbc75575b0f /blog
parentae995e5f6ccb96fbfd70f768ac12e4cc38324bb6 (diff)
downloadnorsk-urskog-main-da6f6a43f456444f1d6b9d350c4babb20d589fd9.tar.gz
norsk-urskog-main-da6f6a43f456444f1d6b9d350c4babb20d589fd9.tar.bz2
norsk-urskog-main-da6f6a43f456444f1d6b9d350c4babb20d589fd9.zip
Legg til styling of en plugin for å håndtere tracklists.
Diffstat (limited to 'blog')
-rw-r--r--blog/_assets/stylesheets/_tracklist.scss32
-rw-r--r--blog/_assets/stylesheets/main.scss1
-rw-r--r--blog/_plugins/tracklist.rb54
3 files changed, 87 insertions, 0 deletions
diff --git a/blog/_assets/stylesheets/_tracklist.scss b/blog/_assets/stylesheets/_tracklist.scss
new file mode 100644
index 0000000..e019a12
--- /dev/null
+++ b/blog/_assets/stylesheets/_tracklist.scss
@@ -0,0 +1,32 @@
+.track-list {
+ .track {
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 8mm;
+ header {
+ font-size: 120%;
+ font-weight: bold;
+ padding: 2mm;
+ background-color: rgba(29, 96, 129, 0.26);
+ .track-artist {
+ text-transform: uppercase;
+ }
+ .track-title {
+ font-style: italic;
+ }
+ }
+ .track-info {
+ padding: {
+ left: 10mm;
+ right: 5mm;
+ top: 3mm;
+ bottom: 3mm;
+ }
+ background-color: rgba(0, 0, 0, 0.7);
+ display: flex;
+ img {
+ margin-right: 3mm;
+ }
+ }
+ }
+}
diff --git a/blog/_assets/stylesheets/main.scss b/blog/_assets/stylesheets/main.scss
index c553c40..ffc99a5 100644
--- a/blog/_assets/stylesheets/main.scss
+++ b/blog/_assets/stylesheets/main.scss
@@ -6,6 +6,7 @@
@import "post";
@import "concerts";
@import "volunteers";
+@import "tracklist";
body {
background-color: black;
diff --git a/blog/_plugins/tracklist.rb b/blog/_plugins/tracklist.rb
new file mode 100644
index 0000000..afbc469
--- /dev/null
+++ b/blog/_plugins/tracklist.rb
@@ -0,0 +1,54 @@
+# Tags for helping with track lists
+#
+module Jekyll
+ class BeginTrackListTag < Liquid::Tag
+ def initialize(tag, text, tokens)
+ super
+ end
+
+ def render(context)
+ %q{<div class="track-list"><h2>Track list:</h2>}
+ end
+ end
+
+ class EndTrackListTag < Liquid::Tag
+ def initialize(tag, text, tokens)
+ super
+ end
+
+ def render(context)
+ %q{</div>}
+ end
+ end
+
+ class TrackTag < Liquid::Tag
+ def initialize(tag, text, tokens)
+ super
+ @num, @artist, @title, @url = text.split('|')
+ end
+
+ def render(context)
+ %Q{<article class="track"><header>
+ <span class="track-num">#{@num}</span> -
+ <span class="track-artist"><a href="#{@url}">#{@artist}</a></span> -
+ <span class="track-title">#{@title}</span></header>
+ <section class="track-info">
+ }
+ end
+ end
+
+ class EndTrackTag < Liquid::Tag
+ def initialize(tag, text, tokens)
+ super
+ end
+
+ def render(context)
+ %Q{</section></article>}
+ end
+ end
+end
+
+Liquid::Template.register_tag('begin_track_list', Jekyll::BeginTrackListTag)
+Liquid::Template.register_tag('end_track_list', Jekyll::EndTrackListTag)
+Liquid::Template.register_tag('track', Jekyll::TrackTag)
+Liquid::Template.register_tag('end_track', Jekyll::EndTrackTag)