hugo.soucy.cc

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

commit 3ccfcb21a687dba2aa89029e7c4553aa80fe9c11
parent b48a1097b91e204cf55693572abf87f808f1e38f
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Tue, 23 Jan 2018 17:06:13 -0500

Change meta keywords from a json arrays.

Diffstat:
Mcontent/note/2017/05/retirer-la-couche-pandoc-de-fakestache-ssg.json | 2+-
Mcontent/note/2017/05/twitter-partage-vos-donnees-personnelles.json | 2+-
Mcontent/note/2017/05/utilisation-des-variables-css.json | 2+-
Mcontent/note/2017/06/100-millions-de-certificats-pour-lets-encrypt.json | 2+-
Mcontent/note/2017/06/le-velo-cest-dangereux.json | 2+-
Mcontent/note/2017/06/politique-numerique-que-jaimerais.json | 2+-
Mcontent/note/2017/06/using-css-variables-correctly.json | 2+-
Mcontent/note/2017/07/why-the-indie-web-movement-is-so-important.json | 2+-
Mcontent/note/2017/09/bacteries-communiqueraient-avec-des-decharges-electriques.json | 2+-
Mcontent/note/2017/09/barbares-se-substitus-aux-piliers.json | 2+-
Mcontent/note/2017/09/le-poil-de-la-bete.json | 2+-
Mcontent/note/2017/09/lesbricodeurs-replyto-status-909427743573577728.json | 2+-
Mcontent/note/2017/10/ghandi-je-suis-pret-a-mourir-pour-plusieurs-causes-a-tuer-pour-aucune.json | 2+-
Mcontent/note/2017/10/openbsd-6.2-sen-vient-a-la-mi-octobre.json | 2+-
Mcontent/note/2017/10/reply-to-saralfddin93-for-status-914965952898457600.json | 2+-
Mcontent/note/2017/10/setup-a-desktop-environment-under-openbsd-with-xfce.json | 2+-
Mcontent/note/2017/10/test-de-repost-en-posse-3.json | 2+-
Mcontent/note/2017/10/why-we-sleep.json | 2+-
Mcontent/note/2017/11/rip-au-capitaine-crochet-de-la-pop-quebecoise.json | 2+-
Mcontent/note/2017/12/betty-davis-is-wonderwoman.json | 2+-
Mcontent/note/2017/12/halt-and-catch-fire-soundtrack.json | 2+-
Mcontent/note/2017/12/mother-s-maiden-name-not-secure.json | 2+-
Mcontent/note/2017/12/openbsd-mise-a-jour-reussie.json | 2+-
Mcontent/note/2018/01/activitypub-is-now-a-w3c-recommendation.json | 2+-
Mcontent/note/2018/01/alec-helps-companies-activate-onion-services.json | 2+-
Mcontent/note/2018/01/an-introduction-to-the-indieweb.json | 2+-
Mcontent/note/2018/01/nos-courriels-pistes.json | 2+-
Mcontent/note/2018/01/orbots-16th-makes-using-tor-on-android-better.json | 2+-
Mcontent/note/2018/01/what-emacs-theme-is-that-3.json | 2+-
Mcontent/txt/bash/2017/03/manuel-taskrunner.json | 2+-
Mcontent/txt/openbsd/2017/11/aide-memoire-openbsd.json | 2+-
Mtag.lua | 67+++++++++++++++++++++++++++----------------------------------------
Mtemplates/partials/head.mustache | 4+---
33 files changed, 59 insertions(+), 74 deletions(-)

diff --git a/content/note/2017/05/retirer-la-couche-pandoc-de-fakestache-ssg.json b/content/note/2017/05/retirer-la-couche-pandoc-de-fakestache-ssg.json @@ -3,7 +3,7 @@ "date":"2017-05-15", "datetime":"14:00:47", "id":"tag:hugo.soucy.cc,2017-05-15:2017/05/retirer-la-couche-pandoc-de-fakestache-ssg", - "keywords":"pandoc, markdown.pl, fakestache", + "keywords":["pandoc","markdown.pl"], "template":"note", "title":"Retirer la couche Pandoc de FakeStache SSG", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/05/twitter-partage-vos-donnees-personnelles.json b/content/note/2017/05/twitter-partage-vos-donnees-personnelles.json @@ -3,7 +3,7 @@ "date":"2017-05-18", "datetime":"10:22:09", "id":"tag:hugo.soucy.cc,2017-05-18:2017/05/twitter-partage-vos-donnees-personnelles", - "keywords":"twitter, data", + "keywords":["twitter"], "template":"note", "title":"Twitter partage vos données personnelles", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/05/utilisation-des-variables-css.json b/content/note/2017/05/utilisation-des-variables-css.json @@ -3,7 +3,7 @@ "date":"2017-05-16", "datetime":"11:40:39", "id":"tag:hugo.soucy.cc,2017-05-16:2017/05/utilisation-des-variables-css", - "keywords":"webdev, css, variables, css, calc()", + "keywords":["webdev","css","variables","css"], "template":"note", "title":"Curieux de l'utilisation des variables CSS", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/06/100-millions-de-certificats-pour-lets-encrypt.json b/content/note/2017/06/100-millions-de-certificats-pour-lets-encrypt.json @@ -3,7 +3,7 @@ "date":"2017-06-29", "datetime":"11:25:49", "id":"tag:hugo.soucy.cc,2017-06-29:2017/06/100-millions-de-certificats-pour-lets-encrypt", - "keywords":"Let's Encrypt, ssl, webdev, chiffrement", + "keywords":["Let's Encrypt","ssl","webdev"], "template":"note", "title":"100 millions de certificats pour Let's Encrypt", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/06/le-velo-cest-dangereux.json b/content/note/2017/06/le-velo-cest-dangereux.json @@ -3,7 +3,7 @@ "date":"2017-06-26", "datetime":"07:57:21", "id":"tag:hugo.soucy.cc,2017-06-26:2017/06/le-velo-cest-dangereux", - "keywords":"vélo,transport,voiture", + "keywords":["vélo","transport"], "template":"note", "title":"Le vélo c'est dangereux", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/06/politique-numerique-que-jaimerais.json b/content/note/2017/06/politique-numerique-que-jaimerais.json @@ -3,7 +3,7 @@ "date":"2017-06-26", "datetime":"08:16:59", "id":"tag:hugo.soucy.cc,2017-06-26:2017/06/politique-numerique-que-jaimerais", - "keywords":"nuérique, politique, internet", + "keywords":["nuérique","politique"], "template":"note", "title":"politique numérique que j'aimerais", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/06/using-css-variables-correctly.json b/content/note/2017/06/using-css-variables-correctly.json @@ -3,7 +3,7 @@ "date":"2017-06-28", "datetime":"10:50:45", "id":"tag:hugo.soucy.cc,2017-06-28:2017/06/using-css-variables-correctly", - "keywords":"css, variable, custom properties, webdev", + "keywords":["css","variable","custom properties"], "template":"note", "title":"Using CSS variables correctly", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/07/why-the-indie-web-movement-is-so-important.json b/content/note/2017/07/why-the-indie-web-movement-is-so-important.json @@ -3,7 +3,7 @@ "date":"2017-07-03", "datetime":"10:54:19", "id":"tag:hugo.soucy.cc,2017-07-03:2017/07/why-the-indie-web-movement-is-so-important", - "keywords":"indieweb", + "keywords":[], "template":"note", "title":"Why the Indie Web movement is so important", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/09/bacteries-communiqueraient-avec-des-decharges-electriques.json b/content/note/2017/09/bacteries-communiqueraient-avec-des-decharges-electriques.json @@ -3,7 +3,7 @@ "date":"2017-09-12", "datetime":"19:25:27", "id":"tag:hugo.soucy.cc,2017-09-12:2017/09/bacteries-communiqueraient-avec-des-decharges-electriques", - "keywords":"science, bactérie, biophysique", + "keywords":["science","bactérie"], "template":"note", "title":"Bactéries communiqueraient avec des décharges électriques", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/09/barbares-se-substitus-aux-piliers.json b/content/note/2017/09/barbares-se-substitus-aux-piliers.json @@ -3,7 +3,7 @@ "date":"2017-09-16", "datetime":"16:01:36", "id":"tag:hugo.soucy.cc,2017-09-16:2017/09/barbares-se-substitus-aux-piliers", - "keywords":"pensée, politique", + "keywords":["pensée"], "template":"note", "title":"Barbares se substitus aux piliers", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/09/le-poil-de-la-bete.json b/content/note/2017/09/le-poil-de-la-bete.json @@ -3,7 +3,7 @@ "date":"2017-09-17", "datetime":"20:32:23", "id":"tag:hugo.soucy.cc,2017-09-17:2017/09/le-poil-de-la-bete", - "keywords":"poésie, quotidien", + "keywords":["poésie"], "template":"note", "title":"Le poil de la bête", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/09/lesbricodeurs-replyto-status-909427743573577728.json b/content/note/2017/09/lesbricodeurs-replyto-status-909427743573577728.json @@ -3,7 +3,7 @@ "date":"2017-09-17", "datetime":"13:37:49", "id":"tag:hugo.soucy.cc,2017-09-17:2017/09/lesbricodeurs-replyto-status-909427743573577728", - "keywords":"posse, indieweb, workflow", + "keywords":["posse","indieweb"], "template":"note", "title":"@LesBricodeurs replyto status 909427743573577728", "updated":"2017-11-20T08:32:02", diff --git a/content/note/2017/10/ghandi-je-suis-pret-a-mourir-pour-plusieurs-causes-a-tuer-pour-aucune.json b/content/note/2017/10/ghandi-je-suis-pret-a-mourir-pour-plusieurs-causes-a-tuer-pour-aucune.json @@ -3,7 +3,7 @@ "date":"2017-10-02", "datetime":"13:25:53", "id":"tag:hugo.soucy.cc,2017-10-02:2017/10/ghandi-je-suis-pret-a-mourir-pour-plusieurs-causes-a-tuer-pour-aucune", - "keywords":"ghandi, non-violence, tweet", + "keywords":["ghandi","non-violence"], "template":"note", "title":"Ghandi: je suis prêt à mourir pour plusieurs causes; à tuer pour aucune", "updated":"2018-01-16T13:44:54" diff --git a/content/note/2017/10/openbsd-6.2-sen-vient-a-la-mi-octobre.json b/content/note/2017/10/openbsd-6.2-sen-vient-a-la-mi-octobre.json @@ -3,7 +3,7 @@ "date":"2017-10-02", "datetime":"14:07:36", "id":"tag:hugo.soucy.cc,2017-10-02:2017/10/openbsd-6.2-sen-vient-a-la-mi-octobre", - "keywords":"openbsd, unix, release", + "keywords":["openbsd","unix"], "template":"note", "title":"OpenBSD 6.2 s'en vient à la mi-octobre", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/10/reply-to-saralfddin93-for-status-914965952898457600.json b/content/note/2017/10/reply-to-saralfddin93-for-status-914965952898457600.json @@ -3,7 +3,7 @@ "date":"2017-10-03", "datetime":"09:12:52", "id":"tag:hugo.soucy.cc,2017-10-03:2017/10/reply-to-saralfddin93-for-status-914965952898457600", - "keywords":"openbsd, release", + "keywords":["openbsd"], "template":"note", "title":"Reply to @saralfddin93 for status 914965952898457600", "updated":"2017-11-20T08:32:02", diff --git a/content/note/2017/10/setup-a-desktop-environment-under-openbsd-with-xfce.json b/content/note/2017/10/setup-a-desktop-environment-under-openbsd-with-xfce.json @@ -3,7 +3,7 @@ "date":"2017-10-10", "datetime":"09:12:26", "id":"tag:hugo.soucy.cc,2017-10-10:2017/10/setup-a-desktop-environment-under-openbsd-with-xfce", - "keywords":"openbsd,xfce", + "keywords":["openbsd"], "template":"note", "title":"Setup a desktop environment under OpenBSD with XFCE", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/10/test-de-repost-en-posse-3.json b/content/note/2017/10/test-de-repost-en-posse-3.json @@ -3,7 +3,7 @@ "date":"2017-10-03", "datetime":"22:03:11", "id":"tag:hugo.soucy.cc,2017-10-03:2017/10/test-de-repost-en-posse-3", - "keywords":"indieweb, quote, posse", + "keywords":["indieweb","quote"], "template":"note", "title":"Test de repost en POSSE", "updated":"2017-11-20T08:32:02" diff --git a/content/note/2017/10/why-we-sleep.json b/content/note/2017/10/why-we-sleep.json @@ -3,7 +3,7 @@ "date":"2017-10-01", "datetime":"20:00:08", "id":"tag:hugo.soucy.cc,2017-10-01:2017/10/why-we-sleep", - "keywords":"tweet, sleep, matrix, nasa", + "keywords":["tweet","sleep","matrix"], "template":"note", "title":"Why we sleep?", "updated":"2018-01-16T13:44:54" diff --git a/content/note/2017/11/rip-au-capitaine-crochet-de-la-pop-quebecoise.json b/content/note/2017/11/rip-au-capitaine-crochet-de-la-pop-quebecoise.json @@ -4,7 +4,7 @@ "datetime":"16:15:42", "description":"", "id":"tag:hugo.soucy.cc,2017-11-27:2017/11/rip-au-capitaine-crochet-de-la-pop-quebecoise", - "keywords":"", + "keywords":[], "template":"note", "title":"RIP au capitaine crochet de la pop québécoise", "updated":"2017-11-28T08:58:16" diff --git a/content/note/2017/12/betty-davis-is-wonderwoman.json b/content/note/2017/12/betty-davis-is-wonderwoman.json @@ -3,7 +3,7 @@ "date":"2017-12-29", "datetime":"10:57:57", "id":"tag:hugo.soucy.cc,2017-12-29:2017/12/betty-davis-is-wonderwoman", - "keywords":"music", + "keywords":[], "template":"note", "title":"Betty Davis is Wonderwoman", "updated":"2018-01-08T10:36:20" diff --git a/content/note/2017/12/halt-and-catch-fire-soundtrack.json b/content/note/2017/12/halt-and-catch-fire-soundtrack.json @@ -3,7 +3,7 @@ "date":"2017-12-29", "datetime":"13:15:52", "id":"tag:hugo.soucy.cc,2017-12-29:2017/12/halt-and-catch-fire-soundtrack", - "keywords":"Halt and Catch Fire, soundtrack, 80s", + "keywords":["Halt and Catch Fire","soundtrack"], "template":"note", "title":"Halt and Catch Fire soundtrack", "updated":"2018-01-08T10:36:20" diff --git a/content/note/2017/12/mother-s-maiden-name-not-secure.json b/content/note/2017/12/mother-s-maiden-name-not-secure.json @@ -3,7 +3,7 @@ "date":"2017-12-31", "datetime":"10:19:44", "id":"tag:hugo.soucy.cc,2017-12-31:2017/12/mother-s-maiden-name-not-secure", - "keywords":"security, internet", + "keywords":["security"], "template":"note", "title":"Mother's maiden name not secure", "updated":"2018-01-08T10:36:20" diff --git a/content/note/2017/12/openbsd-mise-a-jour-reussie.json b/content/note/2017/12/openbsd-mise-a-jour-reussie.json @@ -3,7 +3,7 @@ "date":"2017-12-29", "datetime":"10:21:29", "id":"tag:hugo.soucy.cc,2017-12-29:2017/12/openbsd-mise-a-jour-reussie", - "keywords":"openbsd,update", + "keywords":["openbsd"], "template":"note", "title":"OpenBSD mise à jour réussie", "updated":"2018-01-08T10:36:20" diff --git a/content/note/2018/01/activitypub-is-now-a-w3c-recommendation.json b/content/note/2018/01/activitypub-is-now-a-w3c-recommendation.json @@ -3,7 +3,7 @@ "date":"2018-01-23", "datetime":"09:14:28", "id":"tag:hugo.soucy.cc,2018-01-23:2018/01/activitypub-is-now-a-w3c-recommendation", - "keywords":"w3c, activitypub, activitystreams, recommendation, indieweb, protocol", + "keywords":["w3c","activitypub","activitystreams","recommendation","indieweb"], "template":"note", "title":"ActivityPub is now a W3C Recommendation", "updated":"2018-01-23T09:34:33" diff --git a/content/note/2018/01/alec-helps-companies-activate-onion-services.json b/content/note/2018/01/alec-helps-companies-activate-onion-services.json @@ -5,7 +5,7 @@ "date":"2018-01-18", "datetime":"12:59:47", "id":"tag:hugo.soucy.cc,2018-01-18:2018/01/alec-helps-companies-activate-onion-services", - "keywords":"Tor, Onion Services, EOTK", + "keywords":["Tor","Onion Services"], "template":"note", "title":"Alec Helps Companies Activate Onion Services", "updated":"2018-01-18T13:09:04" diff --git a/content/note/2018/01/an-introduction-to-the-indieweb.json b/content/note/2018/01/an-introduction-to-the-indieweb.json @@ -3,7 +3,7 @@ "date":"2018-01-15", "datetime":"15:06:31", "id":"tag:hugo.soucy.cc,2018-01-15:2018/01/an-introduction-to-the-indieweb", - "keywords":"indieweb,primer,indépendance numérique", + "keywords":["indieweb","primer"], "template":"note", "title":"An Introduction to the IndieWeb", "updated":"2018-01-16T13:41:53" diff --git a/content/note/2018/01/nos-courriels-pistes.json b/content/note/2018/01/nos-courriels-pistes.json @@ -5,7 +5,7 @@ "date":"2018-01-08", "datetime":"15:24:28", "id":"tag:hugo.soucy.cc,2018-01-08:2018/01/nos-courriels-pistes", - "keywords":"tracking,spy,facebook,privacy", + "keywords":["tracking","spy","facebook"], "template":"note", "title":"Nos courriels pistés", "updated":"2018-01-15T15:10:33" diff --git a/content/note/2018/01/orbots-16th-makes-using-tor-on-android-better.json b/content/note/2018/01/orbots-16th-makes-using-tor-on-android-better.json @@ -3,7 +3,7 @@ "date":"2018-01-06", "datetime":"09:35:26", "id":"tag:hugo.soucy.cc,2018-01-06:2018/01/orbots-16th-makes-using-tor-on-android-better", - "keywords":"tor,orbot,android,anonymity", + "keywords":["tor","orbot","android"], "template":"note", "title":"Orbot's 16th makes using Tor on Android better", "updated":"2018-01-16T13:44:54" diff --git a/content/note/2018/01/what-emacs-theme-is-that-3.json b/content/note/2018/01/what-emacs-theme-is-that-3.json @@ -3,7 +3,7 @@ "date":"2018-01-19", "datetime":"13:27:19", "id":"tag:hugo.soucy.cc,2018-01-19:2018/01/what-emacs-theme-is-that-3", - "keywords":"emacs, theme, question, twitter", + "keywords":["emacs","theme","question"], "template":"note", "title":"What Emacs theme is that", "updated":"2018-01-19T14:29:33", diff --git a/content/txt/bash/2017/03/manuel-taskrunner.json b/content/txt/bash/2017/03/manuel-taskrunner.json @@ -2,7 +2,7 @@ "date":"2017-03-12", "datetime":"11:03:16", "id":"tag:hugo.soucy.cc,2017-03-12:2017/03/manuel-taskrunner", - "keywords":"task runner, bash, grunt, gulp", + "keywords":["task runner","bash","grunt"], "template":"default", "title":"Manuel un task runner en bash", "updated":"2017-11-20T08:32:02" diff --git a/content/txt/openbsd/2017/11/aide-memoire-openbsd.json b/content/txt/openbsd/2017/11/aide-memoire-openbsd.json @@ -4,7 +4,7 @@ "datetime":"21:03:10", "description":"Notes personnelles à propos de l'utilisation d'OpenBSD", "id":"tag:hugo.soucy.cc,2017-11-23:2017/11/aide-memoire-openbsd", - "keywords":"openbsd,cheatsheet,howto", + "keywords":["openbsd","cheatsheet"], "template":"default", "title":"Aide-mémoire OpenBSD", "updated":"2017-11-28T08:58:16" diff --git a/tag.lua b/tag.lua @@ -1,37 +1,11 @@ -- +dofile("site.config.lua") + local inspect = require("inspect") local json = require("dkjson") local lfs = require("lfs") local path = require("path") -function string:charAt(index) - return string.sub(self, index, index) -end - - -local ShortUrl = { - alphabet = "23456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ-_" -} - ---print(ShortUrl.alphabet:charAt(1)) - -function ShortUrl:encode(num) - local base = self.alphabet:len() - local str = "" - - - while num > 0 do - str = self.alphabet:charAt(num % base) .. str; - num = math.floor(num / base); - end - - print(str) - - return str -end - -ShortUrl:encode(117) - local function pullfilecontent(pathtofile) local file = assert(io.open(pathtofile, "r")) local content = file:read "*a" @@ -41,26 +15,39 @@ local function pullfilecontent(pathtofile) return content end +local function tablelength(tab) + local count = 0 -local function getpagetags() - dofile("site.config.lua") + for _ in pairs(tab) do + count = count + 1 + end + + return count +end +local function getpagetags() + local contentpath = lfs.currentdir() .. SITE.PATHS.CONTENT local tags = {} path.each( - lfs.currentdir() .. SITE.PATHS.CONTENT .. "/*.json", - function(j) - local metas = json.decode(pullfilecontent(j)) - - --print(inspect(metas)) + contentpath .. "/*.json", + function(jsn) + local metas = json.decode(pullfilecontent(jsn)) if metas.keywords ~= nil then - for tag in metas.keywords:gmatch("([^,]+),%s*") do - tags[tag] = {} - + local pagepath = jsn:sub((contentpath):len() + 1) .. ".html" - --tags[#tag+1] = j + for t in metas.keywords:gmatch("([^,]+),%s*") do + tags[t] = {} end + + + -- for k, v in pairs(tags) do + -- if metas.keywords:match(k) then + -- table.insert(tags[k], pagepath) + -- end + -- end + print("------------") end end, { @@ -75,4 +62,4 @@ end --return getpagetags ---getpagetags() +getpagetags() diff --git a/templates/partials/head.mustache b/templates/partials/head.mustache @@ -33,9 +33,7 @@ <meta name="description" content="{{ description }}" /> {{/ description }} - {{# keywords }} - <meta name="keywords" content="{{ keywords }}" /> - {{/ keywords }} + <meta name="keywords" content="{{# keywords }}{{ . }}, {{/ keywords }}" /> <meta name="google-site-verification" content="-JraS76m4WZOftgNjizPIzRPC0MkCNNfxmPV4MGkJsc" /> </head>