From da6f6a43f456444f1d6b9d350c4babb20d589fd9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 16 Apr 2019 20:43:45 +0200 Subject: =?UTF-8?q?Legg=20til=20styling=20of=20en=20plugin=20for=20=C3=A5?= =?UTF-8?q?=20h=C3=A5ndtere=20tracklists.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog/_assets/stylesheets/_tracklist.scss | 32 +++++++++++++++++++ blog/_assets/stylesheets/main.scss | 1 + blog/_plugins/tracklist.rb | 54 ++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 blog/_assets/stylesheets/_tracklist.scss create mode 100644 blog/_plugins/tracklist.rb (limited to 'blog') 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{

Track list:

} + end + end + + class EndTrackListTag < Liquid::Tag + def initialize(tag, text, tokens) + super + end + + def render(context) + %q{
} + end + end + + class TrackTag < Liquid::Tag + def initialize(tag, text, tokens) + super + @num, @artist, @title, @url = text.split('|') + end + + def render(context) + %Q{
+ #{@num} - + #{@artist} - + #{@title}
+
+ } + end + end + + class EndTrackTag < Liquid::Tag + def initialize(tag, text, tokens) + super + end + + def render(context) + %Q{
} + 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) -- cgit v1.2.3