diff options
author | Justin Berthault <justin.berthault@zaclys.net> | 2017-09-22 20:41:41 +0300 |
---|---|---|
committer | Justin Berthault <justin.berthault@zaclys.net> | 2017-09-22 20:41:41 +0300 |
commit | f52f1b1dd7dd4f28d9ce2f62952feaadf997793d (patch) | |
tree | 73409ae1f19ae12f5d2871bfb67cda56d44b9ce9 | |
parent | 6081af82c8ffe4aad929dd35cf0af841caba8e04 (diff) |
Add the possibility to display and link to the song you were listening while blogging
- Use the frontmatter parameter `song:[title](link)`
- The parameter is markdownified
- If it's not in the frontmatter the blog post will not render the block
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | layouts/_default/single.html | 7 | ||||
-rw-r--r-- | static/css/style.css | 11 |
3 files changed, 18 insertions, 1 deletions
@@ -15,6 +15,7 @@ As of today **Huginn** supports : - Javascript lightbox powered by Featherlight - A `lightbox` shortcode for simple one-image display (activated in frontmatter with `lightbox = True`) - A `gallery` shortcode to display all images in a directory(activated in frontmatter with `gallery = True`) + - Displaying a link and the name of a song you were listening at while writing a post (activated in frontmatter with `song: [title](link)`) ## Shortcodes diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 862f5b0..d37ac2c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -31,7 +31,7 @@ - <a class="tags" href="{{ "/tags/" | relLangURL }}{{ . | urlize }}"> #{{ . }} </a> - {{ end }} + {{ end }} </div> </header> {{ if .TableOfContents }} @@ -40,6 +40,11 @@ {{ .TableOfContents }} </details> {{ end }} + {{ with .Params.song }} + <div class="nowlistening"> + {{ . | markdownify }} + </div> + {{ end }} {{ .Content }} <article> {{ $related := .Site.RegularPages.Related . | first 5 }} diff --git a/static/css/style.css b/static/css/style.css index bd98611..268e2b2 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -198,6 +198,17 @@ img { .gallery-item .thumbnail { max-width: 80%; } +.nowlistening { + padding: 1rem 2rem; + border: 1px #8d7edc solid; + border-radius: 3px; + background: #f0f0f0; + text-align: center; +} +.nowlistening:before { + content: "Ce billet fut écrit en écoutant :"; + +} @media only screen and (min-width: 900px) { aside { float: left; |