commit fd684484560743edc279ce4a35ad25567796d1b0
parent d241dc82cc9d8fd6f24c727b34dbe3156706e231
Author: Hugo Soucy <hugo@soucy.cc>
Date: Tue, 10 Nov 2020 18:21:27 -0500
Add or modify templates
Diffstat:
15 files changed, 319 insertions(+), 171 deletions(-)
diff --git a/templates/curriculum-vitae.html b/templates/curriculum-vitae.html
@@ -0,0 +1,2 @@
+<% local cv = cv() %>
+<%- cv -%>
diff --git a/templates/default-index.html b/templates/default-index.html
@@ -1,33 +1,16 @@
-<article>
- <div>
+<article class="h-entry hentry">
+ <div class="e-content">
<%- content %>
</div>
-
<% if children then %>
- <div>
- <ul>
- <% table.sort(children, function(a , b) return tonumber(a.time_created) > tonumber(b.time_created) end) %>
- <% for i, child in ipairs(children) do %>
- <li>
- <%- child.date -%>
- <h2>
- <a href="<%= child.rellink -%>"><%- child.title -%></a>
- </h2>
- <%- child.content -%>
- </li>
- <% end %>
- </ul>
- </div>
+ <ol>
+ <% table.sort(children, function(a , b) return tonumber(a.time_created) > tonumber(b.time_created) end) %>
+ <% for i, child in ipairs(children) do %>
+ <li>
+ <a href="<%= child.rellink -%>"><%= child.title -%></a> —
+ <time class="dt-published" datetime="<%= child.date -%>T<%= child.datetime -%>"><%= child.date -%></time>
+ </li>
+ <% end %>
+ </ol>
<% end %>
-
- <footer>
- <ul>
- <li>
- Publié le
- <time class="dt-published" datetime="<%= date -%>T<%= datetime -%>">
- <%= date -%>
- </time>
- </li>
- </ul>
- </footer>
</article>
diff --git a/templates/default.html b/templates/default.html
@@ -1,16 +1,21 @@
-<article>
- <div>
- <%- content %>
- </div>
+<article class="h-entry hentry">
+ <%- content %>
<footer>
- <ul>
- <li>
- Publié le
- <time class="dt-published" datetime="<%= date -%>T<%= datetime -%>">
- <%= date -%>
- </time>
- </li>
- </ul>
+ <p>
+ Publié le
+ <time class="dt-published" datetime="<%= date -%>T<%= datetime -%>"><%= date -%></time>,
+ par
+ <a
+ class="p-author author h-card"
+ href="<%= author.uri -%>"
+ rel="author">
+ <i><%= 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>
+ </p>
</footer>
</article>
diff --git a/templates/head.html b/templates/head.html
@@ -1,20 +1,63 @@
<head>
<meta charset="utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><%= title -%> — <%= domainname -%></title>
- <!-- <base href="<%= baseurl -%>" /> -->
- <!-- <link rel="stylesheet" href="<%= baseurl -%>/css/styles.css" /> -->
- <!-- <link href="<%= permalink -%>" hreflang="<%= language -%>" rel="canonical" /> -->
+ <link
+ href="/css/ui.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" />
<meta name="author" content="<%= author.name -%>" />
<meta name="generator" content="<%= metas.generator -%>" />
- <% if metas.description then %>
- <meta name="description" content="<%= metas.description -%>" />
+
+ <% if description then %>
+ <meta content="<%= description -%>" name="description" />
<% end %>
<% if keywords then %>
<% local _keywords = table.concat(keywords,',') %>
<meta name="keywords" content="<%= _keywords -%>" />
<% end %>
+ <!-- Feed Atom -->
+ <link
+ href="/<%= os.date('%Y') -%>/index.xml"
+ rel="alternate"
+ title="Publications de l'année <%= os.date('%Y') -%>"
+ type="application/atom+xml" />
+ <!-- Switchboard is a WebSub hub -->
+ <link href="https://hugo.soucy.cc/" rel="self" />
+ <link href="https://switchboard.p3k.io/" rel="hub">
+ <!-- Webmentions -->
+ <link href="https://webmention.herokuapp.com/api/webmention" rel="webmention" />
+ <link href="https://webmention.io/hugo.soucy.cc/webmention" rel="webmention" />
+ <link href="https://webmention.io/hugo.soucy.cc/xmlrpc" rel="pingback" />
+ <!-- Me elsewhere -->
+ <% for _, relme in ipairs(author.relme) do %>
+ <link href="<%= relme -%>" rel="me" />
+ <% end %>
</head>
diff --git a/templates/index.html b/templates/index.html
@@ -0,0 +1,11 @@
+<article
+ prefix="foaf: http://xmlns.com/foaf/0.1/ dc: http://purl.org/dc/terms/">
+ <div
+ class="h-card hcard vcard"
+ id="hs"
+ resource="#hs"
+ typeof="Person"
+ vocab="http://schema.org/">
+ <%- content %>
+ </div>
+</article>
diff --git a/templates/layout.html b/templates/layout.html
@@ -1,17 +1,45 @@
<!DOCTYPE html>
<html lang="<%= language -%>">
<%- head %>
- <% local posttype = posttype or '' %>
- <body class="<%- posttype -%>">
- <header class="header-banner" role="banner">
- <%- navigation %>
- </header>
- <main id="m">
+ <% local posttype = posttype or 'default' %>
+ <body class="<%- template or posttype -%>" id="t">
+ <a class="go-to-nav visuallyhidden--lg focusable" href="#n">
+ <!-- <i aria-hidden="true" class="ico-menu"></i> -->
+ <span class="visuallyhidden--to-lg">Aller à la </span>navigation
+ </a>
+
+ <a class="go-to-content visuallyhidden focusable" href="#m">Aller au contenu</a>
+
+ <main class="main" id="m">
<%- post %>
</main>
+ <%- navigation %>
+
<footer class="footer-banner">
- <time>2020</time>
+ <div class="footer-banner__wrapper">
+ <nav>
+ <a
+ <% if rellink == '/archives.html' then %>
+ aria-current="page"
+ <% end %>
+ href="/archives.html">Archives</a>
+ |
+ <a
+ <% if rellink == '/abonnement.html' then %>
+ aria-current="page"
+ <% end %>
+ href="/abonnement.html">Me suivre</a>
+ </nav>
+
+ <div>
+ <a
+ href="https://creativecommons.org/licenses/by/2.5/ca/deed.fr"
+ rel="external license"
+ title="Licence Creative Commons, Attribution 2.5 Canada. Lien externe">CC BY 2.5 CA</a> |
+ <time><%= os.date('%Y') -%></time>
+ </div>
+ </div>
</footer>
</body>
</html>
diff --git a/templates/navigation.html b/templates/navigation.html
@@ -1,24 +1,30 @@
<nav class="nav" id="n" data-rellink="<%= rellink -%>">
- <li>
- <a
- <% if rellink == '/index.html' then %>
- aria-current="page"
- <% end %>
- href="/"
- rel="index">Intro</a>
- </li>
- <li>
- <a
- <% if rellink == 'note/' then %>
- aria-current="page"
- <% end %>
- href="/note">note</a>
- </li>
- <li>
- <a
- <% if rellink == 'txt/' then %>
- aria-current="page"
- <% end %>
- href="/txt">Textes</a>
- </li>
+ <h2 class="visuallyhidden">Navigation</h2>
+ <ol class="nav__list">
+ <li class="nav__item">
+ <a
+ <% if rellink == '' then %>
+ aria-current="page"
+ <% end %>
+ class="nav__link"
+ href="/"
+ rel="index">Intro</a>
+ </li>
+ <li class="nav__item">
+ <a
+ <% if rellink == '2020/' then %>
+ aria-current="page"
+ <% end %>
+ class="nav__link"
+ href="/2020">Publications</a>
+ </li>
+ <li class="nav__item">
+ <a
+ <% if rellink == '/file/curriculum-vitae.html' then %>
+ aria-current="page"
+ <% end %>
+ class="nav__link"
+ href="/file/curriculum-vitae.html">CV</a>
+ </li>
+ </ol>
</nav>
diff --git a/templates/posttypes/article.html b/templates/posttypes/article.html
@@ -1,4 +1,4 @@
-<article class="h-entry">
+<article class="h-entry hentry">
<h1 class="p-name">
<%- title %>
</h1>
diff --git a/templates/posttypes/bookmark.html b/templates/posttypes/bookmark.html
@@ -1,34 +1,54 @@
<article class="h-entry hentry">
- <a class="u-bookmark-of" href="<%= url -%>" rel="external">
- <%- title -%>
- </a>
+ <h1>
+ <a
+ class="u-bookmark-of h-cite"
+ href="<%= url -%>"
+ rel="external nofollow">
+ <%- title -%>
+ </a>
+ </h1>
- <% if keywords then %>
- <ul>
- <% for i, keyword in ipairs(keywords) do %>
- <li><small><%- keyword -%></small></li>
+ <div class="e-content">
+ <%- content -%>
+
+ <% if keywords then %>
+ <ul class="hentry__categories">
+ <% for i, keyword in ipairs(keywords) do %>
+ <li>
+ <em class="p-category"><%- keyword -%></em>
+ </li>
+ <% end %>
+ </ul>
<% end %>
- </ul>
- <% end %>
+ </div>
+ <footer class="hentry__footer">
+ <div>
+ Publié le <time class="dt-published" datetime="<%= date -%>T<%= datetime -%>"><%= date -%></time>,
+ par <a class="p-author author h-card" href="<%= author.uri -%>" rel="author"><i><%= 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>.
+ <% if tonumber(os.date('%Y%m%d%H%M%S', time_modification)) > tonumber(time_created) then %>
+ Mise à jour <time class="dt-updated"><%= os.date('%Y-%m-%d %H:%M:%S', time_modification) -%></time>.
+ <% end %>
+ </div>
- <footer>
- <p>
- Publié le
- <time class="dt-published" datetime="<%= date -%>T<%= datetime -%>">
- <%= date -%>
- </time>,
- par
- <a
- class="p-author author h-card"
- href="<%= author.uri -%>"
- rel="author">
- <i><%= author.name -%></i>
- <img
- alt=""
- class="u-photo visuallyhidden"
- src="http://assets.soucy.cc/images/hugosoucy/favicon/hs-autoportrait-2010-nb-favion-32x32.png"/>
+ <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>
+ <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>
</a>
- </p>
+ </div>
</footer>
+
+ <a
+ aria-hidden="true"
+ class="visuallyhidden"
+ href="https://brid.gy/publish/mastodon"></a>
+ <a
+ aria-hidden="true"
+ class="visuallyhidden"
+ href="https://fed.brid.gy/"></a>
</article>
diff --git a/templates/posttypes/like.html b/templates/posttypes/like.html
@@ -1,4 +1,4 @@
-<article class="h-entry">
+<article class="h-entry hentry">
<p class="p-summary">
Liked:
<a
diff --git a/templates/posttypes/note-index.html b/templates/posttypes/note-index.html
@@ -1,33 +1,16 @@
-<article class="h-entry hentry as-note">
- <div class="p-name e-content">
+<article class="h-entry hentry">
+ <div class="e-content">
<%- content %>
</div>
-
<% if children then %>
- <div>
- <ul>
- <!-- Mettre se mécanisme dans le module list; par défaut desc; a modifier en asc, avec une propriété dans le .lua d'un index -->
- <% table.sort(children, function(a , b) return tonumber(a.time_created) > tonumber(b.time_created) end) %>
- <% for i, child in ipairs(children) do %>
- <li>
- <%- child.time_created -%>
- <h2>
- <a href="<%= child.rellink -%>"><%- child.title -%></a>
- </h2>
- </li>
- <% end %>
- </ul>
- </div>
+ <ol>
+ <% table.sort(children, function(a , b) return tonumber(a.time_created) > tonumber(b.time_created) end) %>
+ <% for i, child in ipairs(children) do %>
+ <li>
+ <a href="<%= child.rellink -%>"><%= child.title -%></a> —
+ <time class="dt-published" datetime="<%= child.date -%>T<%= child.datetime -%>"><%= child.date -%></time>
+ </li>
+ <% end %>
+ </ol>
<% end %>
-
- <footer>
- <ul>
- <li>
- Publié le
- <time class="dt-published" datetime="<%= date -%>T<%= datetime -%>">
- <%= date -%>
- </time>
- </li>
- </ul>
- </footer>
</article>
diff --git a/templates/posttypes/note.html b/templates/posttypes/note.html
@@ -1,25 +1,39 @@
<article class="h-entry hentry as-note">
- <div class="p-content e-content">
+ <h1>
+ <%= date -%> @ <%= datetime -%>
+ </h1>
+
+ <div class="p-name p-content e-content">
<%- content %>
</div>
- <footer>
- <p>
- Publié le
- <time class="dt-published" datetime="<%= date -%>T<%= datetime -%>">
- <%= date -%>
- </time>,
- par
- <a
- class="p-author author h-card"
- href="<%= author.uri -%>"
- rel="author">
- <i><%= author.name -%></i>
- <img
- alt=""
- class="u-photo visuallyhidden"
- src="http://assets.soucy.cc/images/hugosoucy/favicon/hs-autoportrait-2010-nb-favion-32x32.png"/>
+ <footer class="hentry__footer">
+ <div>
+ Publié le <time class="dt-published" datetime="<%= date -%>T<%= datetime -%>"><%= date -%></time>,
+ par <a class="p-author author h-card" href="<%= author.uri -%>" rel="author"><i><%= 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>.
+ <% if tonumber(os.date('%Y%m%d%H%M%S', time_modification)) > tonumber(time_created) then %>
+ Mise à jour <time class="dt-updated"><%= os.date('%Y-%m-%d %H:%M:%S', time_modification) -%></time>.
+ <% end %>
+ </div>
+
+ <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>
+ <span><span class="visuallyhidden">Retourner aux </span>publications</span>
</a>
- </p>
+ <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>
+ <span><span class="visuallyhidden">Retourner aux </span>notes</span>
+ </a>
+ </div>
</footer>
+
+ <a
+ aria-hidden="true"
+ class="visuallyhidden"
+ href="https://brid.gy/publish/mastodon"></a>
+ <a
+ aria-hidden="true"
+ class="visuallyhidden"
+ href="https://fed.brid.gy/"></a>
</article>
diff --git a/templates/posttypes/reply.html b/templates/posttypes/reply.html
@@ -1,29 +1,34 @@
<article class="h-entry hentry">
- <a href="<%= replyto -%>" class="u-in-reply-to" rel="external">
- <%= replyto -%>
- </a>
+ <div>
+ En réponse à <cite><a href="<%- url -%>" class="u-in-reply-to" rel="external"><%- url -%></a></cite>.
+ </div>
+
+ <blockquote class="h-cite hcite">
+ <div class="e-content"><%- replyto -%></div>
+ </blockquote>
- <div class="p-name p-content">
+ <div class="e-content p-name p-content">
<%- content %>
</div>
- <footer>
- <p>
- Publié le
- <time class="dt-published" datetime="<%= date -%>T<%= datetime -%>">
- <%= date -%>
- </time>,
- par
- <a
- class="p-author author h-card"
- href="<%= author.uri -%>"
- rel="author">
- <i><%= author.name -%></i>
- <img
- alt=""
- class="u-photo visuallyhidden"
- src="http://assets.soucy.cc/images/hugosoucy/favicon/hs-autoportrait-2010-nb-favion-32x32.png"/>
+ <footer class="hentry__footer">
+ <div>
+ Publié le <time class="dt-published" datetime="<%= date -%>T<%= datetime -%>"><%= date -%></time>,
+ par <a class="p-author author h-card" href="<%= author.uri -%>" rel="author"><i><%= 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>.
+ <% if tonumber(os.date('%Y%m%d%H%M%S', time_modification)) > tonumber(time_created) then %>
+ Mise à jour <time class="dt-updated"><%= os.date('%Y-%m-%d %H:%M:%S', time_modification) -%></time>.
+ <% end %>
+ </div>
+
+ <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>
+ <span><span class="visuallyhidden">Retourner aux </span>publications</span>
+ </a>
+ <a class="button" href="/<%= os.date('%Y') -%>/rp" 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>réponses</span>
</a>
- </p>
+ </div>
</footer>
</article>
diff --git a/templates/posttypes/repost.html b/templates/posttypes/repost.html
@@ -1,4 +1,4 @@
-<article class="h-entry">
+<article class="h-entry hentry">
<a
class="u-repost-of"
href="<%= content -%>"
diff --git a/templates/publications.html b/templates/publications.html
@@ -0,0 +1,48 @@
+<article class="h-feed hfeed">
+ <%- 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 %>
+
+ <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>
+ <% end %>
+</article>