hugo.soucy.cc

The personnal website source code of Hugo Soucy. Creates from an homebrewed static website generator (Ferron).
Log | Files | Refs

commit 93ba8931d0f10ca22cdf00e025ed636abd96d3c0
parent a7aa02343b3c30d7360e983ce012d2a3ffd53a20
Author: Hugo Soucy <hugo.soucy@equisoft.com>
Date:   Fri, 23 Aug 2019 08:10:08 -0400

Split notes templates into partials

Diffstat:
Mtemplates/note-index.mustache | 64+++++++++++++++++++++++-----------------------------------------
Mtemplates/note.mustache | 132++++++++++++++++++++++++++++++++++++-------------------------------------------
Atemplates/partials/note-body.mustache | 3+++
Atemplates/partials/quote-body.mustache | 15+++++++++++++++
4 files changed, 101 insertions(+), 113 deletions(-)

diff --git a/templates/note-index.mustache b/templates/note-index.mustache @@ -4,50 +4,32 @@ <body id="note" class="note"> <main class="note__main"> - <div class="layout"> - {{{ content }}} + {{{ content }}} - <ol class="note__list"> - {{# entries }} - <li class="note__item h-entry hentry as-note" id="id{{{ shortlink }}}"> - {{# citeurl }} - <blockquote class="note__blockquote p-name e-content"> - <div class="note__blockquote__quote"> - {{{ content }}} - </div> - {{# cite }} - <footer class="note__blockquote__footer"> - &mdash; - <cite class="note__blockquote__cite h-cite"> - <a class="u-url p-author" href="{{ citeurl }}" rel="external nofollow"> - {{ cite }} - </a> - </cite> - </footer> - {{/ cite }} - </blockquote> - {{/ citeurl }} + <ol class="note__list"> + {{# entries }} + <li class="note__item h-entry hentry as-note" id="id{{{ shortlink }}}"> + {{# citeurl }} + {{> quote-body }} + {{/ citeurl }} - {{^ citeurl }} - <div class="note__blocknote p-name e-content"> - {{{ content }}} - </div> - {{/ citeurl }} + {{^ citeurl }} + {{> note-body }} + {{/ citeurl }} - <footer class="note__footer"> - Publié le - <a class="note__link u-url u-uid u-syndication" - {{# permalink }} - href="{{ permalink }}" - {{/ permalink }} - rel="syndication"> - <time class="dt-published dt-updated" {{# datetime }}datetime="{{ date }}T{{ datetime }}"{{/ datetime }}>{{ date }}</time></a>. - <span class="visuallyhidden">par <em class="p-author author h-card">{{ site.author.name }}</em></span> - </footer> - </li> - {{/entries}} - </ol> - </div> + <footer class="note__footer"> + Publié le + <a class="note__link u-url u-uid u-syndication" + {{# permalink }} + href="{{ permalink }}" + {{/ permalink }} + rel="syndication"> + <time class="dt-published dt-updated" {{# datetime }}datetime="{{ date }}T{{ datetime }}"{{/ datetime }}>{{ date }}</time></a>. + <span class="visuallyhidden">par <em class="p-author author h-card">{{ site.author.name }}</em></span> + </footer> + </li> + {{/entries}} + </ol> </main> <footer class="note_footer-banner footer-banner"> diff --git a/templates/note.mustache b/templates/note.mustache @@ -4,54 +4,19 @@ <body id="note" class="note"> <main> - <article class="layout h-entry hentry as-note"> - <div class="layout__vcenter"> - <h1 class="visuallyhidden">{{ title }}</h1> + <article class="h-entry hentry as-note"> + <h1 class="visuallyhidden">{{ title }}</h1> - {{# citeurl }} - <blockquote class="note__blockquote p-name e-content"> - <div class="note__blockquote__quote"> - {{{ content }}} - </div> - {{# cite }} - <footer class="note__blockquote__footer"> - &mdash; - <cite class="note__blockquote__cite h-cite"> - <a class="u-url p-author" href="{{ citeurl }}" rel="external nofollow"> - {{ cite }} - </a> - </cite> - </footer> - {{/ cite }} - </blockquote> - {{/ citeurl }} + {{^ citeurl }} + {{> note-body }} + {{/ citeurl }} - {{^ citeurl }} - <div class="note__blocknote p-name e-content"> - {{{ content }}} - </div> - {{/ citeurl }} - - <footer class="note__footer"> - {{# replyto }} - <p> - <a class="note__link--replyto u-in-reply-to" - href="{{ replyto }}" - rel="in-reply-to"> - &#x21b3; En réponse à {{ replyto }}. - </a> - </p> - {{/ replyto }} - - {{# repostof }} - <p> - <a class="note__link--replyto u-repost u-repost-of" - href="{{ repostof }}"> - &#x2672; {{ repostof }}. - </a> - </p> - {{/ repostof }} + {{# citeurl }} + {{> quote-body }} + {{/ citeurl }} + <footer class="note__footer"> + {{# replyto }} <p> {{# permalink }} <a class="u-url u-uid u-syndication bookmark" @@ -67,40 +32,63 @@ title="Shortlink">{{{ shortlink }}}</a>) {{/ shortlink }} --> - Publié le <time class="dt-published" {{# datetime }}datetime="{{ date }}T{{ datetime }}"{{/ datetime }}>{{ date }}</time> - par - <a class="p-author author h-card" href="{{{ site.baseurl }}}#hs" rel="author"> - <i>{{ site.author.name }}</i> - <img alt="" - class="u-photo visuallyhidden" - src="http://assets.soucy.cc/images/hugosoucy/favicon/hs-autoportrait-2010-nb-favion-32x32.png"/> + {{# repostof }} + <p> + <a class="note__link--replyto u-repost u-repost-of" + href="{{ repostof }}"> + &#x2672; {{ repostof }}. </a> - {{# updated }} et modifié le <time class="dt-updated">{{ updated }}</time>{{/ updated }}. - <br/>&crarr; <a href="{{{ site.baseurl }}}/note/#id{{{ shortlink }}}">Retourner aux notes</a>. </p> - </footer> + {{/ repostof }} + + <p> + {{# permalink }} + <a class="u-url u-uid u-syndication bookmark" + href="{{{ permalink }}}" + rel="bookmark" + title="Permalink">#</a> + {{/ permalink }} + + {{# shortlink }} + (<a href="{{{ site.url }}}/{{{ shortlink }}}" + type="text/html" + rel="shortlink" + title="Shortlink">{{{ shortlink }}}</a>) + {{/ shortlink }} + + Publié le <time class="dt-published" {{# datetime }}datetime="{{ date }}T{{ datetime }}"{{/ datetime }}>{{ date }}</time> + par + <a class="p-author author h-card" href="{{{ site.baseurl }}}#hs" rel="author"> + <i>{{ site.author.name }}</i> + <img alt="" + class="u-photo visuallyhidden" + src="http://assets.soucy.cc/images/hugosoucy/favicon/hs-autoportrait-2010-nb-favion-32x32.png"/> + </a> + {{# updated }} et modifié le <time class="dt-updated">{{ updated }}</time>{{/ updated }}. + <br/>&crarr; <a href="{{{ site.baseurl }}}/note/#id{{{ shortlink }}}">Retourner aux notes</a>. + </p> + </footer> - <aside class="webmention-herokuapp"> - <script id="webmention-hosted"> - (function () { - var sn = document.createElement("script"), s = document.getElementsByTagName("script")[0], url; - url = document.querySelectorAll ? document.querySelectorAll("link[rel~=canonical]") : false; - url = url && url[0] ? url[0].href : false; - sn.type = "text/javascript"; sn.async = true; - sn.src = "//webmention.herokuapp.com/api/embed?url=" + encodeURIComponent(url || window.location); - s.parentNode.insertBefore(sn, s); - }()); - </script> - </aside> - </div> + <aside class="webmention-herokuapp"> + <script id="webmention-hosted"> + (function () { + var sn = document.createElement("script"), s = document.getElementsByTagName("script")[0], url; + url = document.querySelectorAll ? document.querySelectorAll("link[rel~=canonical]") : false; + url = url && url[0] ? url[0].href : false; + sn.type = "text/javascript"; sn.async = true; + sn.src = "//webmention.herokuapp.com/api/embed?url=" + encodeURIComponent(url || window.location); + s.parentNode.insertBefore(sn, s); + }()); + </script> + </aside> {{# bridgy }} <a aria-hidden="true" - class="visuallyhidden" - href="https://brid.gy/publish/twitter"></a> + class="visuallyhidden" + href="https://brid.gy/publish/twitter"></a> <a aria-hidden="true" - class="visuallyhidden" - href="https://fed.brid.gy/"></a> + class="visuallyhidden" + href="https://fed.brid.gy/"></a> {{/ bridgy }} </article> </main> diff --git a/templates/partials/note-body.mustache b/templates/partials/note-body.mustache @@ -0,0 +1,3 @@ +<div class="note__blocknote p-name e-content"> + {{{ content }}} +</div> diff --git a/templates/partials/quote-body.mustache b/templates/partials/quote-body.mustache @@ -0,0 +1,15 @@ +<blockquote class="note__blockquote p-name e-content"> + <div class="note__blockquote__quote"> + {{{ content }}} + </div> + {{# cite }} + <footer class="note__blockquote__footer"> + &mdash; + <cite class="note__blockquote__cite h-cite"> + <a class="u-url p-author" href="{{ citeurl }}" rel="external nofollow"> + {{ cite }} + </a> + </cite> + </footer> + {{/ cite }} +</blockquote>