hugo.soucy.cc

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

commit 74f2f0b75465d53fe43b220f127f5c8ab4a4efc9
parent b1f830400f69c717b8df9d6694639ec09cf5d011
Author: Hugo Soucy <hugo.soucy@equisoft.com>
Date:   Sun,  6 Oct 2019 13:13:10 -0400

Make some tests with lua watcher and plugins

Diffstat:
Mconfig.lua | 1+
Mplugins/httpd/init.lua | 16+++++++++-------
Mstatic/dst/css/styles.min.css | 288++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
Mstatic/src/css/styles.scss | 2+-
4 files changed, 276 insertions(+), 31 deletions(-)

diff --git a/config.lua b/config.lua @@ -51,6 +51,7 @@ return { modules = { 'pegasus', 'sass', + 'watcher', } }, diff --git a/plugins/httpd/init.lua b/plugins/httpd/init.lua @@ -1,6 +1,6 @@ --- httpd.lua +-- httpd.init.lua ---package.path = package.path .. ';../../?.lua' +package.path = package.path .. ';../../?.lua' local httpd = {} local httpdmeta = { @@ -18,12 +18,14 @@ function httpd.init(sitedata) }) return server:start(function(request, response) - if request._path == '' or '/' then - print("response path ", request._path) + local path = (request:path() == '/' or request:path() == '') and 'index.html' or request.path() + print(inspect(request:path()), path) + print(inspect(response)) - -- response:statusCode(301) - -- response:addHeader('Location', './' .. request._path .. 'index.html') - end + response:addHeader('Location', path) + + -- print('= Request: ' .. inspect(request.firstLine)) + -- print('= Response: ' .. inspect(response.headFirstLine)) end) end diff --git a/static/dst/css/styles.min.css b/static/dst/css/styles.min.css @@ -1,37 +1,279 @@ +/* Globals */ +@font-face { + font-family: "ISO"; + font-style: normal; + font-weight: 400; + src: url("../fonts/iso/ISOv0.5-Regular.woff") format("woff"); } + +@font-face { + font-family: "ISO"; + font-style: normal; + font-weight: 700; + src: url("../fonts/iso/ISOv0.5-Bold.woff") format("woff"); } + +@font-face { + font-family: "Leitura News"; + font-style: normal; + font-weight: 400; + src: url("../fonts/leitura/leituranews-italic4-webfont.woff") format("woff"); } + +/* Global Vars */ :root { font-size: calc(1vw + 1vh + .5vmin); -} + /* Colors */ + --base-bg-color: #ffffff; + --base-fg-color: #111111; + --base-link-color: #0000ff; + --base-visited-color: #8000FF; + --code-bg-color: #ffffff; + --code-fg-color: #8000FF; + --shadow-color: #cccccc; + --nav-bg-color: #111111; + --nav-bg-color-hover: #0000ff; + --nav-fg-color: #ffffff; + --nav-fg-color-hover: #ffffff; + --nav-outline-color: #ffffff; + --quote-br-color: #cccccc; + /* Fonts */ + --base-font-family: ISO, monospace; + --logo-font-family: Leitura News, serif; } +/* BASE STYLES */ html, body { height: 100%; min-height: 100%; -} + position: relative; } + +body, +button, +input, +select, +textarea { + color: var(--base-fg-color); + font: 16px/1.6 var(--base-font-family); } + @media screen and (min-width: 40rem) { + body, + button, + input, + select, + textarea { + font: 1rem/1.6 var(--base-font-family); } } body { - background: #eee; - color: #111; - font: 1rem/1.6 monospace; -} + background: var(--base-bg-color) url("//assets.soucy.cc/images/noise.png") repeat; + margin: 0; + padding: 0; } + +a { + background: linear-gradient(180deg, transparent 70%, aquamarine 0); + color: var(--base-link-color); + text-decoration: none; + transition: all 0.25s ease-in-out; } + a:focus, a:hover { + background: linear-gradient(180deg, transparent 0%, aqua 0); + color: var(--base-fg-color); } + +h1 { + font-size: 2.25rem; } + +h2 { + font-size: 1.6875rem; } + +h3 { + font-size: 1.3125rem; } + +h4 { + font-size: 1.125rem; } + +h5 { + font-size: 1rem; } -body > * { - margin: auto; - max-width: 960px; - width: auto; -} +h6 { + font-size: 0.875rem; } +p, +pre { + margin: 1.25rem 0 1.25rem; } + +pre { + background: var(--code-bg-color); + overflow: auto; + padding: 1rem; } + +code { + background: var(--code-bg-color); + color: var(--code-fg-color); + font-size: .85rem; } + +iframe, img { - max-width: 100%; - width: auto; -} + max-width: 100%; } + +blockquote { + border-left: 0.75rem solid var(--quote-br-color); + display: block; + margin: 1rem 0; + padding-left: 1.5rem; } .visuallyhidden { - border:0; - clip:rect(0 0 0 0); - height:1px; - margin:-1px; - overflow:hidden; - padding:0; - position:absolute; - width:1px; -} + border: 0 !important; + clip: rect(1px, 1px, 1px, 1px); + height: 1px !important; + overflow: hidden; + padding: 0 !important; + position: absolute !important; + width: 1px !important; } + +.go-to-menu__ico { + color: #000; + position: absolute; + margin-left: 2px; + margin-top: 10px; + width: 17px; + height: 1px; + background-color: currentColor; } + +.go-to-menu__ico:before { + content: ''; + position: absolute; + top: -5px; + left: 0; + width: 17px; + height: 1px; + background-color: currentColor; } + +.go-to-menu__ico:after { + content: ''; + position: absolute; + top: 5px; + left: 0; + width: 17px; + height: 1px; + background-color: currentColor; } + +.nav { + align-items: center; + background: var(--base-fg-color); + display: flex; + flex-flow: row wrap; + justify-content: center; + width: 100%; } + .nav__link { + background: var(--nav-bg-color); + color: var(--nav-fg-color); + display: block; + line-height: 1; + padding: 0.75rem; + text-decoration: none; + transition: all 0.25s ease-in-out; } + .nav__link:focus, .nav__link:hover { + background: var(--nav-bg-color-hover); + color: var(--nav-fg-color-hover); } + .nav__link:focus { + outline: 2px solid var(--nav-outline-color); + outline-offset: -2px; } + +/* CSS Modules */ +.index .logo { + font: 400 3rem/1 var(--logo-font-family); + text-shadow: 3px 3px var(--shadow-color); } + +main.h-card { + padding: 2rem; } + main.h-card h1 { + font-size: 1rem; + font-weight: 400; } + main.h-card footer { + font-size: 0.75rem; } + main.h-card .p-name { + font-size: 1.35rem; } + main.h-card .u-photo { + clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); + float: right; + height: auto; + margin: 1rem; + mix-blend-mode: hard-light; + shape-outside: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); + width: 15rem; } + +.h-entry footer { + font-size: 0.75rem; } + +main.h-entry { + padding: 2rem; } + +.h-feed { + padding: 2rem; } + +.as-note { + overflow: hidden; } + .note-index .as-note { + border-bottom: 1px solid var(--shadow-color); + margin-bottom: 4rem; + padding-bottom: 4rem; } + +.cv > main, +.cv > footer { + padding: 2rem; } + +.cv__hr { + margin-top: 2.5rem; } + +.cv__contactinfos { + overflow: hidden; } + +.cv__contactinfos__key, +.cv__contactinfos__value { + float: left; } + +.cv__contactinfos__value + .cv__contactinfos__key { + clear: left; } + +.cv__contactinfos__key::after { + content: "\00a0:\00a0"; + display: inline; } + +.cv__experience, +.cv__education, +.cv__course { + margin-bottom: 1.5rem; } + +.cv__experience__name, +.cv__education__name, +.cv__course__name { + font-size: 1.3125rem; } + +.note { + padding: 0 2rem; } + .note > main { + align-items: center; + display: flex; + height: auto; + justify-content: center; + min-height: 100vh; + margin: auto; } + +.webmention-container { + background: rgba(9, 9, 9, 0.1); + font-size: 0.75rem; + margin-top: 1.5rem; + padding: 1rem; } + +.webmention-mention { + margin-bottom: 1rem; } + +.webmention-mention:last-child { + margin-bottom: 0; } + +.webmention-author a { + display: inline; } + +.webmention-author img { + display: inline-block; + margin-right: 0.5rem; + max-width: 2rem; + height: auto; } + +.webmention-summary { + margin: 0.5rem 0 0; } diff --git a/static/src/css/styles.scss b/static/src/css/styles.scss @@ -8,7 +8,7 @@ @import "global/_go-to-menu.scss"; @import "global/_nav.scss"; -/* Modules */ +/* CSS Modules */ @import "modules/_index.scss"; @import "modules/_h-card.scss"; @import "modules/_h-entry.scss";