hscc

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

commit 01eabc25bd4312d1f9498480e02de10b691cd39f
parent 973ec9c74de49c0941d69f83fb48b5ec51885124
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sat, 21 Nov 2020 10:20:50 -0500

Edit templates

Diffstat:
Mtemplates/head.html | 23++---------------------
Mtemplates/layout.html | 13++++++++++---
Mtemplates/navigation.html | 2+-
Mtemplates/posttypes/bookmark.html | 11++++++++---
Mtemplates/posttypes/note.html | 8++++++--
Mtemplates/posttypes/reply.html | 7++++---
Mtemplates/publications.html | 92+++++++++++++++++++++++++++++++++++++++++++++----------------------------------
7 files changed, 83 insertions(+), 73 deletions(-)

diff --git a/templates/head.html b/templates/head.html @@ -3,32 +3,12 @@ <meta name="viewport" content="width=device-width, initial-scale=1" /> <title><%= title -%> &mdash; <%= domainname -%></title> <link - href="/css/ui.min.css" + href="/css/index.min.css" id="ui_css" media="screen" rel="stylesheet" type="text/css"/> - <script id="cuttingTheMustard"> - let ux_css; - - /* If the browser is for HTML5 then */ - if('querySelector' in document - && 'localStorage' in window - && 'addEventListener' in window) { - /* UX CSS */ - ux_css = document.createElement('link'); - ux_css.href = '/css/ux.min.css'; - ux_css.id = 'ux_css'; - ux_css.media = 'screen and (min-width: 20rem)'; - ux_css.rel = 'stylesheet'; - ux_css.type = 'text/css'; - - /* Insert the `ux_css` element */ - document.getElementById('ui_css').insertAdjacentElement('afterend', ux_css); - } - </script> - <link href="<%= permalink -%>" hreflang="<%= language -%>" rel="canonical" /> <meta name="robots" content="index, follow" /> @@ -60,4 +40,5 @@ <% for _, relme in ipairs(author.relme) do %> <link href="<%= relme -%>" rel="me" /> <% end %> + <link href="/humans.txt" rel="author" type="text/plain" /> </head> diff --git a/templates/layout.html b/templates/layout.html @@ -2,9 +2,16 @@ <html lang="<%= language -%>"> <%- head %> <% local posttype = posttype or 'default' %> - <body class="<%- template or posttype -%>" id="t"> + <body class="layout <%- template or posttype -%>" id="t"> + <svg height="0" style="position:absolute" viewBox="0 0 80 20" width="0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <symbol id="ico_note" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 2h18v14h-2v2h-2v-2h-2v2h2v2h-2v2H3V2zm2 2v16h8v-6h6V4H5z" fill="currentColor"/></symbol> + <symbol id="ico_bookmark" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 2H6v2h12v16h-2v-2h-2v-2h-4v2H8v2H6V2H4v20h4v-2h2v-2h4v2h2v2h4V2h-2z" fill="currentColor"/></symbol> + <symbol id="ico_nav" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 6h16v2H4V6zm0 5h16v2H4v-2zm16 5H4v2h16v-2z" fill="currentColor"/></symbol> + <symbol id="ico_chevron_left" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 5v2h-2V5h2zm-4 4V7h2v2h-2zm-2 2V9h2v2h-2zm0 2H8v-2h2v2zm2 2v-2h-2v2h2zm0 0h2v2h-2v-2zm4 4v-2h-2v2h2z" fill="currentColor"/></symbol> + <symbol id="ico_corner_down_left" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 16H8v2H6v-2H4v-2h2v-2h2v2h10V4h2v12h-2zM8 12v-2h2v2H8zm0 6v2h2v-2H8z" fill="currentColor"/></symbol> + </svg> <a class="go-to-nav visuallyhidden--lg focusable" href="#n"> - <!-- <i aria-hidden="true" class="ico-menu"></i> --> + <svg class="ico" height="24" role="image" width="24"><use href="#ico_nav"></use></svg> <span class="visuallyhidden--to-lg">Aller à la </span>navigation </a> @@ -14,7 +21,7 @@ <%- post %> </main> - <%- navigation %> + <%- navigation -%> <footer class="footer-banner"> <div class="footer-banner__wrapper"> diff --git a/templates/navigation.html b/templates/navigation.html @@ -1,5 +1,5 @@ <nav class="nav" id="n" data-rellink="<%= rellink -%>"> - <h2 class="visuallyhidden">Navigation</h2> + <h2 class="nav__title visuallyhidden--xs">Navigation</h2> <ol class="nav__list"> <li class="nav__item"> <a diff --git a/templates/posttypes/bookmark.html b/templates/posttypes/bookmark.html @@ -1,4 +1,9 @@ <article class="h-entry hentry"> + <small class="hentry__posttype"> + <svg class="ico" height="24" width="24" role="image"><use href="#ico_bookmark"></use></svg> + Marque-page + </small> + <h1 class="p-name"> <a class="u-bookmark-of h-cite" @@ -34,12 +39,12 @@ <div> <a class="button" href="/<%= os.date('%Y') -%>" rel="up"> - <svg aria-hidden="true" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M2 7H5V17H2V7Z" fill="currentColor" /><path d="M6 12L13.0023 7.00003V17L6 12Z" fill="currentColor" /><path d="M21.0023 7.00003L14 12L21.0023 17V7.00003Z" fill="currentColor" /></svg> + <svg class="ico" height="24" width="24" role="image"><use href="#ico_chevron_left"></use></svg> <span><span class="visuallyhidden">Retourner aux </span>publications</span> </a> <a class="button" href="/<%= os.date('%Y') -%>/mp" rel="up"> - <svg aria-hidden="true" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M18 17L10 12L18 7V17Z" fill="currentColor" /><path d="M6 7H9V17H6V7Z" fill="currentColor" /></svg> - <span><span class="visuallyhidden">Retourner aux </span>marques pages</span> + <svg class="ico" height="24" width="24" role="image"><use href="#ico_chevron_left"></use></svg> + <span><span class="visuallyhidden">Retourner aux </span>marques-pages</span> </a> </div> </footer> diff --git a/templates/posttypes/note.html b/templates/posttypes/note.html @@ -1,4 +1,8 @@ <article class="h-entry hentry as-note"> + <small class="hentry__posttype"> + <svg class="ico" height="24" width="24" role="image"><use href="#ico_note"></use></svg> + Note + </small> <h1> <%= date -%> @ <%= datetime -%> </h1> @@ -24,11 +28,11 @@ <div> <a class="button" href="/<%= os.date('%Y') -%>" rel="up"> - <svg aria-hidden="true" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M2 7H5V17H2V7Z" fill="currentColor" /><path d="M6 12L13.0023 7.00003V17L6 12Z" fill="currentColor" /><path d="M21.0023 7.00003L14 12L21.0023 17V7.00003Z" fill="currentColor" /></svg> + <svg class="ico" height="24" width="24" role="image"><use href="#ico_chevron_left"></use></svg> <span><span class="visuallyhidden">Retourner aux </span>publications</span> </a> <a class="button" href="/<%= os.date('%Y') -%>/nt" rel="up"> - <svg aria-hidden="true" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M18 17L10 12L18 7V17Z" fill="currentColor" /><path d="M6 7H9V17H6V7Z" fill="currentColor" /></svg> + <svg class="ico" height="24" width="24" role="image"><use href="#ico_chevron_left"></use></svg> <span><span class="visuallyhidden">Retourner aux </span>notes</span> </a> </div> diff --git a/templates/posttypes/reply.html b/templates/posttypes/reply.html @@ -1,10 +1,11 @@ <article class="h-entry hentry"> - <div> + <small> + <svg class="ico" height="24" width="24" role="image"><use href="#ico_corner_down_left"></use></svg> En réponse à <cite><a href="<%- url -%>" class="u-in-reply-to" rel="external"><%- url -%></a></cite>. - </div> + </small> <blockquote class="h-cite hcite"> - <div class="e-content"><%- replyto -%></div> + <div class="e-content"><%= replyto -%></div> </blockquote> <div class="e-content p-name p-content"> diff --git a/templates/publications.html b/templates/publications.html @@ -2,47 +2,59 @@ <%- content %> <% if children then %> - <ol class="hfeed__entries"> - <% table.sort(children, function(a , b) return tonumber(a.time_created) > tonumber(b.time_created) end) %> - <% for i, child in ipairs(children) do %> - <li class="h-entry hentry<% if child.posttype == 'note' then %> as-note<% end %>"> - <% if child.posttype == 'bookmark' then %> - <h2 class="p-name"> - <a - class="u-bookmark-of h-cite" - href="<%= child.url %>" - rel="external"> - <%- child.title -%> - </a> - </h2> - <% else %> - <h2 class="visuallyhidden"> - <%= child.date -%> @ <%= child.datetime -%> - </h2> - <% end %> + <ol class="hfeed__entries"> + <% table.sort(children, function(a , b) return tonumber(a.time_created) > tonumber(b.time_created) end) %> + <% for i, child in ipairs(children) do %> + <li class="h-entry hentry<% if child.posttype == 'note' then %> as-note<% end %>"> + <% if child.posttype == 'bookmark' then %> + <small class="hentry__posttype"> + <svg class="ico" height="24" width="24" role="image"><use href="#ico_bookmark"></use></svg> + Marque-page + </small> + <h2 class="p-name"> + <a + class="u-bookmark-of h-cite" + href="<%= child.url %>" + rel="external"> + <%- child.title -%> + </a> + </h2> + <% elseif child.posttype == 'note' then %> + <small class="hentry__posttype"> + <svg class="ico" height="24" width="24" role="image"><use href="#ico_note"></use></svg> + Note + </small> + <h2 class="visuallyhidden"> + <%= child.date -%> @ <%= child.datetime -%> + </h2> + <% else %> + <h2 class="visuallyhidden"> + <%= child.date -%> @ <%= child.datetime -%> + </h2> + <% end %> - <div class="e-content<% if child.posttype == 'note' then %> p-name<% end %>"> - <%- child.content -%> - </div> + <div class="e-content<% if child.posttype == 'note' then %> p-name<% end %>"> + <%- child.content -%> + </div> - <footer class="hentry__footer"> - <% if child.keywords and child.posttype == 'bookmark' then %> - <ul class="hentry__categories"> - <% for i, keyword in ipairs(child.keywords) do %> - <li> - <em class="p-category"><%- keyword -%></em> - </li> - <% end %> - </ul> - <% end %> - <div> - Publié le <a class="u-url" href="<%= child.rellink -%>"> - <time class="dt-published" datetime="<%= child.date -%>T<%= child.datetime -%>"><%= child.date -%></time></a>. - <span class="visuallyhidden">Par <em class="p-author author h-card"><%= child.author.name -%></em>.</span> - </div> - </footer> - </li> - <% end %> - </ol> + <footer class="hentry__footer"> + <% if child.keywords and child.posttype == 'bookmark' then %> + <ul class="hentry__categories"> + <% for i, keyword in ipairs(child.keywords) do %> + <li> + <em class="p-category"><%- keyword -%></em> + </li> + <% end %> + </ul> + <% end %> + <div> + Publié le <a class="u-url" href="<%= child.rellink -%>"> + <time class="dt-published" datetime="<%= child.date -%>T<%= child.datetime -%>"><%= child.date -%></time></a>. + <span class="visuallyhidden">Par <em class="p-author author h-card"><%= child.author.name -%></em>.</span> + </div> + </footer> + </li> + <% end %> + </ol> <% end %> </article>