hugo.soucy.cc

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

commit 6a1aee30c3518a360d6aa4ded449f57c24946017
parent 9cc0c7ba48b1db41ed12d143ce4ffb2b1d0916dc
Author: Hugo Soucy <hsoucy@kronostechnologies.com>
Date:   Mon,  4 Feb 2019 08:52:23 -0500

Merge branch 'master' of github.com:hs0ucy/hugo.soucy.cc

Diffstat:
Dhttpd | 16----------------
Dmanuelfile | 86-------------------------------------------------------------------------------
Mplugins/httpd/init.lua | 25++++++++++++++++---------
Dposse | 24------------------------
Dpreprocess_css | 58----------------------------------------------------------
Dpreprocess_javascript | 22----------------------
Dshortlinks | 19-------------------
Dshortlinks.db | 99-------------------------------------------------------------------------------
8 files changed, 16 insertions(+), 333 deletions(-)

diff --git a/httpd b/httpd @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# Open the developpement URL in $BROWSER -# Start the developpement Web server - -# Dependency : -# - https://unix4lyfe.org/darkhttpd - -if hash darkhttpd 2>/dev/null; then - xdg-open "http://localhost:8181" && - - darkhttpd ./public_html --port 8181 -else - echo "- Sorry But You must Install *darkhttpd*." - echo "- Please Visit <https://unix4lyfe.org/darkhttpd/>." -fi diff --git a/manuelfile b/manuelfile @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -# Dependencies : -# - https://github.com/ShaneKilkelly/manuel -# - https://github.com/ShaneKilkelly/manuel-contrib-watch - -# $HOME/.manuel.d/plugins/manuel-contrib-watch -load_plugin manuel-contrib-watch - -# Paths vars -FERRON_PATH=/home/hs0ucy/_01_http/ferron - -SITE_PATH=/home/hs0ucy/_01_http/ferron/sites/hugo.soucy.cc -SITE_DOMAINNAME="hugo.soucy.cc" -SITE_PUBLIC_HTML=public_html -SITE_STATIC_DST=static/dst -SITE_STATIC_SRC=static/src -SITE_TEMPLATES=templates - -# Update partials/cv.mustache -function updatecv () { - # from git@github.com:hs0ucy/Curriculum-vitae.git repository - curl https://raw.githubusercontent.com/hs0ucy/Curriculum-vitae/master/curriculum-vitae.html > "$SITE_TEMPLATES/partials/cv.mustache" -} - -# Concatenate and minify assets -# Then build the static site -function build () { - updatecv && - - ./preprocess_css - ./preprocess_javascript - - case $1 in - -d|--dev) - cd "$FERRON_PATH" && - ./cornelius build --dev - ;; - *) - cd "$FERRON_PATH" && - ./cornelius build - ;; - esac - - echo "- $SITE_DOMAINNAME is builded!" -} - -# Build the static site -# Then deploy it to the web server -function deploy () { - build && - - cd $SITE_PATH - - ./deploy - - echo "- ... and deployed!" -} - -# Concatenate and minify stylesheets -# Then export with rsync -function update_css () { - ./preprocess_css && - - rsync -avmh "$SITE_STATIC_DST/css/" "$SITE_PUBLIC_HTML/css/" -} - -# Concatenate and minify scripts -# Then export with rsync -function update_js () { - ./preprocess_javascript && - - rsync -avmh "$SITE_STATIC_DST/js/" "$SITE_PUBLIC_HTML/js/" -} - -# Watch CSS and JS files -# Then update them -function watch_assets_change () { - - declare -A actions=( - ["*?css"]="update_css" - ["*?js"]="update_js" - ) - - manuel_watch "$SITE_STATIC_SRC/" -} diff --git a/plugins/httpd/init.lua b/plugins/httpd/init.lua @@ -1,18 +1,25 @@ +-- httpd.lua package.path = package.path .. ";../../?.lua" +local httpd = {} +local httpdmeta = { + __call = function(self, key, vars) + print(key) + end +} + local pegasus = require "pegasus" local path = require "path" -local httpd = {} function httpd.init(sitedata) - local server = pegasus:new({ - port = sitedata.config.portdev, - location = "/" .. sitedata.config.sites .. path.basename(sitedata.path) .. sitedata.config.paths.html .. "/" - }) + local server = pegasus:new({ + port = sitedata.config.portdev, + location = "/" .. sitedata.config.sites .. path.basename(sitedata.path) .. sitedata.config.paths.html .. "/" + }) - return server:start(function (request, response) - print("!!!!") - end) + return server:start(function(request, response) + print("!!!!") + end) end -return httpd +return setmetatable(httpd, httpdmeta) diff --git a/posse b/posse @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -# https://indieweb.org/POSSE - -# POSSE to Twitter via Bridgy -# <https://brid.gy/> -# with the Will Norris Webmention app -# <https://willnorris.com/go/webmention> - -unset -v first_db_line - -# Read the first line (last entry) of the fakestache.db -read -r first_db_line < fakestache.db - -# Extract the permalink -last_permalink=$(echo "$first_db_line" | cut -d "|" -f 3) - -# Then send it to the webmention-go app -if hash webmention 2>/dev/null; then - webmention "$last_permalink" -else - echo "- Sorry But You must Install *webmention*." - echo "- Please Visit <https://willnorris.com/go/webmention>." -fi diff --git a/preprocess_css b/preprocess_css @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - -# CSS Preprocessing Script - -# Include mustache for bash as library -. ~/bin/mo - -CSS_DST_PATH=static/dst/css -CSS_SRC_PATH=static/src/css - -# Convert pixels to EMs -px_to_em () { - pixel_size=$1 - pixel_context=16 - - if [ -n "$2" ]; then - pixel_context=$2 - fi - - echo "$(bc <<< "scale=4;$pixel_size/$pixel_context")em" -} - -# Associative array with breakpoints and sizes in EMs -declare -A BREAKPOINTS - -BREAKPOINTS=( - [xxs]=$(px_to_em 360) - [xs]=$(px_to_em 520) - [sm]=$(px_to_em 768) - [md]=$(px_to_em 992) - [lg]=$(px_to_em 1140) -) - -# You must install "Minify CLI" for running this script : -# <https://github.com/tdewolff/minify/tree/master/cmd/minify> -if hash minify 2>/dev/null; then - # CSS Concatenation - cat "$CSS_SRC_PATH/global/fonts.css" \ - "$CSS_SRC_PATH/global/normalize.css" \ - "$CSS_SRC_PATH/global/abstractions.css" \ - "$CSS_SRC_PATH/global/base.css" \ - "$CSS_SRC_PATH/global/helpers.css" \ - "$CSS_SRC_PATH/global/grid.css" \ - "$CSS_SRC_PATH/modules/"*.css \ - > "$CSS_DST_PATH/styles.tmp.css" - - # Replace mustache tags with associative array and co. - mo "$CSS_DST_PATH"/styles.tmp.css > "$CSS_DST_PATH"/styles.css - - # Remove the temporary stylesheet - rm "$CSS_DST_PATH"/styles.tmp.css - - # CSS Minification - minify -v --mime=text/css < "$CSS_DST_PATH"/styles.css > "$CSS_DST_PATH"/styles.min.css -else - echo "- You must install Minify CLI for running this script" - echo "- <https://github.com/tdewolff/minify/tree/master/cmd/minify>" -fi diff --git a/preprocess_javascript b/preprocess_javascript @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# JavaScript Preprocessing Script - -JS_SRC_PATH=static/src/js -JS_DST_PATH=static/dst/js - -# You must install "Minify CLI" for running this script : -# <https://github.com/tdewolff/minify/tree/master/cmd/minify> -if hash minify 2>/dev/null; then - # JavaScript Concatenation - cat "$JS_SRC_PATH/vendor/dom-utilities/dom-utilities.js" \ - "$JS_SRC_PATH/custom/init.js" \ - > "$JS_DST_PATH/script.js" - - # JavaScript Minification - minify -v --mime=text/javascript < "$JS_DST_PATH"/script.js > "$JS_DST_PATH"/script.min.js - -else - echo "- You must install Minify CLI for running this script" - echo "- <https://github.com/tdewolff/minify/tree/master/cmd/minify>" -fi diff --git a/shortlinks b/shortlinks @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -# Dependency -# <https://github.com/ericchiang/pup> - -# Short URL command example -# curl -v "http://x.soucy.cc/?save=y&url=https://words.werd.io/tear-down-the-new-institutions-91516b868a2c" - -# curl -s "http://x.soucy.cc/?save=y&url=https://words.werd.io/tear-down-the-new-institutions-91516b868a2c" | pup '[name="tighturl"] attr{value}' - -while read -r db_entry; do - field_permalink=$(echo $db_entry | cut -d "|" -f 3) - - field_shortlink=$(curl -s "http://x.soucy.cc/?save=y&url=$field_permalink" | pup '[name="tighturl"] attr{value}') - - echo "$field_permalink|$field_shortlink" - -done < fakestache.db > shortlinks.db - diff --git a/shortlinks.db b/shortlinks.db @@ -1,99 +0,0 @@ -http://hugo.soucy.cc/note/2017/10/setup-a-desktop-environment-under-openbsd-with-xfce.html|http://x.soucy.cc/dh -http://hugo.soucy.cc/ce-site-web-explique-markdown.html|http://x.soucy.cc/di -http://hugo.soucy.cc/note/2017/10/test-de-repost-en-posse-3.html|http://x.soucy.cc/dj -http://hugo.soucy.cc/note/2017/10/reply-to-saralfddin93-for-status-914965952898457600.html|http://x.soucy.cc/dk -http://hugo.soucy.cc/note/2017/10/openbsd-6.2-sen-vient-a-la-mi-octobre.html|http://x.soucy.cc/dl -http://hugo.soucy.cc/note/2017/10/ghandi-je-suis-pret-a-mourir-pour-plusieurs-causes-a-tuer-pour-aucune.html|http://x.soucy.cc/dm -http://hugo.soucy.cc/note/2017/10/why-we-sleep.html|http://x.soucy.cc/dn -http://hugo.soucy.cc/note/2017/09/le-poil-de-la-bete.html|http://x.soucy.cc/do -http://hugo.soucy.cc/note/2017/09/lesbricodeurs-replyto-status-909427743573577728.html|http://x.soucy.cc/dp -http://hugo.soucy.cc/note/2017/09/lesbricodeurs-jaime-votre-nom.html|http://x.soucy.cc/dq -http://hugo.soucy.cc/note/2017/09/barbares-se-substitus-aux-piliers.html|http://x.soucy.cc/dr -http://hugo.soucy.cc/note/2017/09/bacteries-communiqueraient-avec-des-decharges-electriques.html|http://x.soucy.cc/ds -http://hugo.soucy.cc/note/2017/07/why-the-indie-web-movement-is-so-important.html|http://x.soucy.cc/dt -http://hugo.soucy.cc/note/2017/06/100-millions-de-certificats-pour-lets-encrypt.html|http://x.soucy.cc/du -http://hugo.soucy.cc/note/2017/06/using-css-variables-correctly.html|http://x.soucy.cc/dv -http://hugo.soucy.cc/note/2017/06/sesame-street-lgbt-pride.html|http://x.soucy.cc/dw -http://hugo.soucy.cc/note/2017/06/petite-contribution-bash-au-task-runner-manuel.html|http://x.soucy.cc/dx -http://hugo.soucy.cc/note/2017/06/politique-numerique-que-jaimerais.html|http://x.soucy.cc/dy -http://hugo.soucy.cc/note/2017/06/le-velo-cest-dangereux.html|http://x.soucy.cc/dz -http://hugo.soucy.cc/note/2017/05/twitter-partage-vos-donnees-personnelles.html|http://x.soucy.cc/e0 -http://hugo.soucy.cc/note/2017/05/utilisation-des-variables-css.html|http://x.soucy.cc/e1 -http://hugo.soucy.cc/note/2017/05/retirer-la-couche-pandoc-de-fakestache-ssg.html|http://x.soucy.cc/e2 -http://hugo.soucy.cc/note/2017/05/pandoc-for-openbsd.html|http://x.soucy.cc/e3 -http://hugo.soucy.cc/note/2017/05/mg-is-micro-gnu-emacs.html|http://x.soucy.cc/e4 -http://hugo.soucy.cc/note/2017/05/fai-associatifs-au-canada.html|http://x.soucy.cc/e5 -http://hugo.soucy.cc/note/2017/05/why-i-love-openbsd.html|http://x.soucy.cc/e6 -http://hugo.soucy.cc/note/2017/05/switching-to-openbsd.html|http://x.soucy.cc/e7 -http://hugo.soucy.cc/note/2017/04/duckduckgo-hacks-for-developers.html|http://x.soucy.cc/e8 -http://hugo.soucy.cc/note/2017/04/updating-all-packages-in-go.html|http://x.soucy.cc/e9 -http://hugo.soucy.cc/note/2017/04/fait-le-respirer-un-peu-ton-code.html|http://x.soucy.cc/ea -http://hugo.soucy.cc/albums-preferes.html|http://x.soucy.cc/eb -http://hugo.soucy.cc/note/2017/03/animista-css-animations-on-demand.html|http://x.soucy.cc/ec -http://hugo.soucy.cc/note/2017/03/moi-jaime-pas-les-courriels-juste-en-html.html|http://x.soucy.cc/ed -http://hugo.soucy.cc/a-propos.html|http://x.soucy.cc/ee -http://hugo.soucy.cc/note/2017/03/github-and-copyleft.html|http://x.soucy.cc/ef -http://hugo.soucy.cc/note/2017/03/appnet-is-another-silo-who-is-shutting-down.html|http://x.soucy.cc/eg -http://hugo.soucy.cc/note/2017/03/vider-le-filelist-dun-input-type-file.html|http://x.soucy.cc/eh -http://hugo.soucy.cc/note/2017/03/why-apple-avoid-the-gpl-3.html|http://x.soucy.cc/ei -http://hugo.soucy.cc/note/2017/03/presentation-de-manuel-un-task-runner-bash.html|http://x.soucy.cc/ej -http://hugo.soucy.cc/txt/bash/2017/03/manuel-taskrunner.html|http://x.soucy.cc/ek -http://hugo.soucy.cc/note/2017/03/vuejs-templates-a-maintenant-son-mode-dans-emacs.html|http://x.soucy.cc/el -http://hugo.soucy.cc/note/2017/03/si-les-etats-unis-envahissaient-le-canada.html|http://x.soucy.cc/em -http://hugo.soucy.cc/note/2017/03/poutine-et-bal-masque.html|http://x.soucy.cc/en -http://hugo.soucy.cc/note/2017/03/revanche-des-librairies-independantes.html|http://x.soucy.cc/eo -http://hugo.soucy.cc/note/2017/01/how-machines-learned-to-speak-human-language.html|http://x.soucy.cc/ep -http://hugo.soucy.cc/note/2017/01/3-500-proces-au-cours-des-30-dernieres-annees.html|http://x.soucy.cc/eq -http://hugo.soucy.cc/note/2017/01/est-ce-une-fausse-nouvelle-car-trop-beau-pour-etre-vrai.html|http://x.soucy.cc/er -http://hugo.soucy.cc/note/2017/01/because-protest-is-an-industry.html|http://x.soucy.cc/es -http://hugo.soucy.cc/note/2017/01/lemprise-de-wallstreet-sur-trump.html|http://x.soucy.cc/et -http://hugo.soucy.cc/note/2017/01/la-ville-facteur-majeur-d-evolution-des-especes.html|http://x.soucy.cc/eu -http://hugo.soucy.cc/note/2016/12/michel-chartrand-aurait-eu-cent-ans-hier.html|http://x.soucy.cc/ev -http://hugo.soucy.cc/note/2016/12/le-peuple-nest-pas-juridiquement-souverain.html|http://x.soucy.cc/ew -http://hugo.soucy.cc/note/2016/12/le-travail-aujourdhui-est-en-voie-de-disparition.html|http://x.soucy.cc/ex -http://hugo.soucy.cc/note/2016/12/larnaque-de-la-dictature-bancaire-continue.html|http://x.soucy.cc/ey -http://hugo.soucy.cc/note/2016/11/would-the-web-s-inventor-give-up-on-free-standards.html|http://x.soucy.cc/ez -http://hugo.soucy.cc/note/2016/11/the-average-american-now-downloads-zero-apps-per-month.html|http://x.soucy.cc/f0 -http://hugo.soucy.cc/note/2016/11/browsers-not-apps-are-the-future-of-mobile.html|http://x.soucy.cc/f1 -http://hugo.soucy.cc/note/2016/11/indieweb-make-your-social-media-posts-open-first.html|http://x.soucy.cc/f2 -http://hugo.soucy.cc/note/2016/10/how-can-i-handle-command-line-arguments-options-to-my-script-easily.html|http://x.soucy.cc/f3 -http://hugo.soucy.cc/note/2016/10/linux-foundation-takes-javascript-under-its-wings.html|http://x.soucy.cc/f4 -http://hugo.soucy.cc/note/2016/10/who-pays-for-the-decentralized-web.html|http://x.soucy.cc/f5 -http://hugo.soucy.cc/note/2016/09/ma-vie-obeit-a-l-attraction-des-livres-nikolski-nicolas-dickner.html|http://x.soucy.cc/f6 -http://hugo.soucy.cc/note/2016/09/why-we-use-progressive-enhancement-to-build-gov-uk.html|http://x.soucy.cc/f7 -http://hugo.soucy.cc/note/2016/09/internet-3-0-peut-on-reprendre-le-controle-des-geants.html|http://x.soucy.cc/f8 -http://hugo.soucy.cc/note/2016/09/ce-que-le-quebec-gagnerait-a-nationaliser-internet.html|http://x.soucy.cc/f9 -http://hugo.soucy.cc/note/2016/09/radio-canada-publicitaire-pour-apple.html|http://x.soucy.cc/fa -http://hugo.soucy.cc/note/2016/08/quoi-ce-n-est-pas-des-femmes-grenouilles.html|http://x.soucy.cc/fb -http://hugo.soucy.cc/note/2016/08/add-key-bindings-to-moving-faster-between-emacs-windows.html|http://x.soucy.cc/fc -http://hugo.soucy.cc/note/2016/08/openbsd-pour-tous.html|http://x.soucy.cc/fd -http://hugo.soucy.cc/note/2016/08/pokemon-go-et-societe-de-surveillance.html|http://x.soucy.cc/fe -http://hugo.soucy.cc/note/2016/08/snowden-pardon-petition-on-facebook.html|http://x.soucy.cc/ff -http://hugo.soucy.cc/note/2016/08/ssh-chat-server-written-ingo.html|http://x.soucy.cc/fg -http://hugo.soucy.cc/note/2016/08/nathalie-normandeau-et-la-radio-de-quebec.html|http://x.soucy.cc/fh -http://hugo.soucy.cc/note/2016/08/vimgifs-et-emacs_gifs.html|http://x.soucy.cc/fi -http://hugo.soucy.cc/note/2016/08/programming-languages-hyperpolyglot.html|http://x.soucy.cc/fj -http://hugo.soucy.cc/note/2016/08/everybody-should-be-twitter-verified.html|http://x.soucy.cc/fk -http://hugo.soucy.cc/note/2016/08/shipping-is-a-feature.html|http://x.soucy.cc/fl -http://hugo.soucy.cc/note/2016/08/matane-budget-participatif.html|http://x.soucy.cc/fm -http://hugo.soucy.cc/note/2016/08/m4-as-css-pre-processor.html|http://x.soucy.cc/fn -http://hugo.soucy.cc/note/2016/08/txti.html|http://x.soucy.cc/fo -http://hugo.soucy.cc/note/2016/07/emacs-sort-delete-matching-duplicate-lines.html|http://x.soucy.cc/fp -http://hugo.soucy.cc/note/2016/06/nous-sommes-eduques-a-croire.html|http://x.soucy.cc/fq -http://hugo.soucy.cc/note/2016/05/firefox-print-background-color.html|http://x.soucy.cc/fr -http://hugo.soucy.cc/note/2016/05/justin-jackson-is-a-fucking-webmaster.html|http://x.soucy.cc/fs -http://hugo.soucy.cc/note/2016/05/jeunes-liberaux-ringards.html|http://x.soucy.cc/ft -http://hugo.soucy.cc/note/2016/05/indieweb-in-a-nutshellown-your-identity-domain-website-content-uiux.html|http://x.soucy.cc/fu -http://hugo.soucy.cc/note/2016/04/tiens-tiens-tiens-le-projet-gnu-revamp-la-page-web.html|http://x.soucy.cc/fv -http://hugo.soucy.cc/note/2016/04/encore-une-fois-je-viens-de-supprimer-mon-compte-facebook.html|http://x.soucy.cc/fw -http://hugo.soucy.cc/note/2016/03/javascript-vanille-underscorejs-font-selon-moi-une-excellente-quipe-youmightnotneedjquery-webdev.html|http://x.soucy.cc/fx -http://hugo.soucy.cc/note/2016/02/encryption-is-the-nsas-friend-20160127nsa_loves_it_when_you_use_pgp.html|http://x.soucy.cc/fy -http://hugo.soucy.cc/note/2016/02/what-is-it-about-society-that-disappoints-you-so-much.html|http://x.soucy.cc/fz -http://hugo.soucy.cc/note/2016/01/tiens-un-article-sur-le-darknet-que-plusieurs-devraient-lire.html|http://x.soucy.cc/g0 -http://hugo.soucy.cc/txt/emacs/2015/06/emacs-101-la-configuration.html|http://x.soucy.cc/d3 -http://hugo.soucy.cc/txt/emacs/2015/06/emacs-101-l-introduction.html|http://x.soucy.cc/g1 -http://hugo.soucy.cc/txt/2014/09/mes-logiciels-libres-preferes.html|http://x.soucy.cc/g2 -http://hugo.soucy.cc/txt/2014/04/bronto-politiciens-de-silos.html|http://x.soucy.cc/g3 -http://hugo.soucy.cc/txt/2014/02/les-partis-politiques-nuisent-ils-a-la-democratie.html|http://x.soucy.cc/g4 -http://hugo.soucy.cc/file/pgp.html|http://x.soucy.cc/g5 -http://hugo.soucy.cc/file/curriculum-vitae.html|http://x.soucy.cc/g6