hscc

Soure code of <https://hugo.soucy.cc>.
git clone git://soucy.cc/hscc.git
Log | Files | Refs

commit 800bfa2774b34133ead1aa0b6938eb51ab72a8b5
parent 000665d20ebba2bb468699dbabb88ecf4886bfcf
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Fri, 25 Feb 2022 21:12:15 -0500

Use include to inject some partials

Diffstat:
Mtemplates/head.html | 114++-----------------------------------------------------------------------------
Mtemplates/layout.html | 34+++++++++-------------------------
Mtemplates/publications.html | 6+++++-
Mtemplates/scripts.html | 2+-
Mtemplates/styles.html | 108+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
Atemplates/svg-sprite.html | 9+++++++++
6 files changed, 132 insertions(+), 141 deletions(-)

diff --git a/templates/head.html b/templates/head.html @@ -3,119 +3,9 @@ <meta name="viewport" content="width=device-width, initial-scale=1" /> <title><%= title -%> &mdash; <%= siteurl:match('^%w+://([^/]+)') -%></title> - <style id="initCSS"> - body, - button, - input, - select, - textarea { - color: #111; - font-family: "Ubuntu mono", monospace; - } - - html, - body { - height: 100%; - min-height: 100%; - position: relative; - } - - body { - background: #f9f9f9; - margin: 0; - padding: 0; - } - - body > * { - margin-top: 1rem; - margin-bottom: 1rem; - } - - body > * > * { - margin-left: auto; - margin-right: auto; - padding: 2rem 1rem; - } - - body > nav, - body > footer, - body > header { - background: #111; - } - - body > nav, - body > nav a, - body > footer, - body > footer a, - body > header, - body > header a { - color: #f9f9f9; - } - - body > footer, - body > header { - margin-top: 0; - } - - body > header { - padding: 1rem 0; - } - - body > nav, - body > footer { - margin-bottom: 0; - } - - h1, - h2, - h3 { - font-family: sans-serif; - } - - aside, - article, - details, - footer, - header, - main, - nav, - section { - display: block - } - - [hidden] { - display: none; - } - - .visuallyhidden { - border: 0; - clip: rect(1px, 1px, 1px, 1px); - height: 1px; - margin: -1px; - overflow: hidden; - padding:0; - position: absolute; - white-space: nowrap; - width: 1px; - } - </style> - - <link - href="/css/index.min.css" - id="indexCSS" - media="only screen and (-webkit-min-device-pixel-ratio:0) and (min-color-index:0), (-ms-high-contrast: none), only all and (min--moz-device-pixel-ratio:0) and (min-resolution: 3e1dpcm)" - rel="stylesheet"/> - - <link - href="/css/print.css" - media="print" - rel="stylesheet"/> - - <link - href="<%= permalink -%>" - hreflang="<%= language -%>" - rel="canonical" /> + <%- include("styles") %> + <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 -%>" /> diff --git a/templates/layout.html b/templates/layout.html @@ -3,16 +3,8 @@ <%- head -%> <% local posttype = posttype or template or 'default' %> <body class="layout <%- template or posttype -%>" id="t"> - <svg aria-hidden="true" height="0" style="position:absolute" 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"><path d="M3 2h18v14h-2v2h-2v-2h-2v2h2v2h-2v2H3V2zm2 2v16h8v-6h6V4H5z" fill="currentColor"/></symbol> - <symbol id="ico_bookmark" width="24" height="24" fill="none"><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"><path d="M4 6h16v2H4V6zm0 5h16v2H4v-2zm16 5H4v2h16v-2z" fill="currentColor"/></symbol> - <symbol id="ico_chevron_left" width="24" height="24" fill="none"><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"><path d="M18 16H8v2H6v-2H4v-2h2v-2h2v2h10V4h2v12h-2zM8 12v-2h2v2H8zm0 6v2h2v-2H8z" fill="currentColor"/></symbol> - <symbol id="ico_article" fill="none" height="24" width="24"><path d="M5 3H3v18h18V3H5zm14 2v14H5V5h14zm-2 2H7v2h10V7zM7 11h10v2H7v-2zm7 4H7v2h7v-2z" fill="currentColor"/></symbol> - <symbol id="ico_link" fill="none" height="24" width="24"><path d="M4 6h7v2H4v8h7v2H2V6h2zm16 0h-7v2h7v8h-7v2h9V6h-2zm-3 5H7v2h10v-2z" fill="currentColor"/></symbol> - </svg> - <header class="header-banner" role="banner"> + <%- include("svg-sprite") %> + <header class="header-banner"> <div> <a href="/" rel="index"> <picture> @@ -21,8 +13,8 @@ </picture> </a> <a class="go-to-nav" href="#n"> - <svg aria-hidden="true" class="ico" height="24" role="image" width="24"><use href="#ico_nav"></use></svg> - <span class="visuallyhidden">Aller au&nbsp;</span>menu<span class="visuallyhidden"> de navigation</span> + <svg aria-hidden="true" class="ico" height="24" role="image" width="24"><use href="#ico_nav"></use></svg> + <span class="visuallyhidden">Aller au&nbsp;</span>menu<span class="visuallyhidden"> de navigation</span> </a> </div> </header> @@ -31,20 +23,12 @@ <%- post %> </main> + <link + href="/css/bottom.min.css" + media="screen" + rel="stylesheet"/> + <%- navigation -%> <%- footer -%> - <script> - (function() { - var indexCSS = document.getElementById('indexCSS'); - - if (window.matchMedia && window.matchMedia(indexCSS.media).matches) { - var script = document.createElement('script'); - - script.src = '/js/index.min.js'; - script.async = true; - document.body.appendChild(script); - } - })(); - </script> </body> </html> diff --git a/templates/publications.html b/templates/publications.html @@ -1,3 +1,7 @@ +<link + href="/css/hfeed.min.css" + media="screen" + rel="stylesheet"/> <article class="h-feed hfeed"> <header class="hfeed__header"> <%- content %> @@ -21,7 +25,7 @@ </div> <% if children then %> - <ol class="hfeed__entries"> + <ol class="hfeed__entries" reversed=""> <% for i = 1, #children do %> <li class="h-entry hentry<% if children[i].posttype == 'note' then %> as-note<% end %>"> <% if children[i].posttype == 'bookmark' then %> diff --git a/templates/scripts.html b/templates/scripts.html @@ -1,3 +1,3 @@ <script> - /* Bonjour Hi */ + /* ! */ </script> diff --git a/templates/styles.html b/templates/styles.html @@ -1,3 +1,107 @@ -<style> - /* !!! */ +<style id="initCSS"> + body, + button, + input, + select, + textarea { + color: #111; + font-family: "Ubuntu mono", monospace; + } + + html, + body { + height: 100%; + min-height: 100%; + position: relative; + } + + body { + background: #f9f9f9; + margin: 0; + padding: 0; + } + + body > * { + margin-top: 1rem; + margin-bottom: 1rem; + } + + body > * > * { + margin-left: auto; + margin-right: auto; + padding: 2rem 1rem; + } + + body > nav, + body > footer, + body > header { + background: #111; + } + + body > nav, + body > nav a, + body > footer, + body > footer a, + body > header, + body > header a { + color: #f9f9f9; + } + + body > footer, + body > header { + margin-top: 0; + } + + body > header { + padding: 1rem 0; + } + + body > nav, + body > footer { + margin-bottom: 0; + } + + h1, + h2, + h3 { + font-family: sans-serif; + } + + aside, + article, + details, + footer, + header, + main, + nav, + section { + display: block + } + + [hidden] { + display: none; + } + + .visuallyhidden { + border: 0; + clip: rect(1px, 1px, 1px, 1px); + height: 1px; + margin: -1px; + overflow: hidden; + padding:0; + position: absolute; + white-space: nowrap; + width: 1px; + } </style> + +<link + href="/css/top.min.css" + id="indexCSS" + media="only screen and (-webkit-min-device-pixel-ratio:0) and (min-color-index:0), (-ms-high-contrast: none), only all and (min--moz-device-pixel-ratio:0) and (min-resolution: 3e1dpcm)" + rel="stylesheet"/> + +<link + href="/css/print.min.css" + media="print" + rel="stylesheet"/> diff --git a/templates/svg-sprite.html b/templates/svg-sprite.html @@ -0,0 +1,9 @@ +<svg aria-hidden="true" height="0" style="position:absolute" 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"><path d="M3 2h18v14h-2v2h-2v-2h-2v2h2v2h-2v2H3V2zm2 2v16h8v-6h6V4H5z" fill="currentColor"/></symbol> + <symbol id="ico_bookmark" width="24" height="24" fill="none"><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"><path d="M4 6h16v2H4V6zm0 5h16v2H4v-2zm16 5H4v2h16v-2z" fill="currentColor"/></symbol> + <symbol id="ico_chevron_left" width="24" height="24" fill="none"><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"><path d="M18 16H8v2H6v-2H4v-2h2v-2h2v2h10V4h2v12h-2zM8 12v-2h2v2H8zm0 6v2h2v-2H8z" fill="currentColor"/></symbol> + <symbol id="ico_article" fill="none" height="24" width="24"><path d="M5 3H3v18h18V3H5zm14 2v14H5V5h14zm-2 2H7v2h10V7zM7 11h10v2H7v-2zm7 4H7v2h7v-2z" fill="currentColor"/></symbol> + <symbol id="ico_link" fill="none" height="24" width="24"><path d="M4 6h7v2H4v8h7v2H2V6h2zm16 0h-7v2h7v8h-7v2h9V6h-2zm-3 5H7v2h10v-2z" fill="currentColor"/></symbol> +</svg>