hscc

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

commit eb263bf1ea8a8712c34bd73ebf6d46fa26bddd33
parent fae4b7232625d949418645588086bc1ef769169c
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Fri,  6 Nov 2020 06:28:04 -0500

Add new things

Diffstat:
Aarchetypes/bookmark.lua.mustache | 8++++++++
Aarchetypes/bookmark.md.mustache | 1+
Abin/bookmark | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/utils/file.lua | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/utils/slugify.lua | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/2020/index.lua | 6++++++
Acontent/2020/index.md | 0
Acontent/2020/mp/decroissance-ou-transition-ecologique.lua | 8++++++++
Acontent/2020/mp/decroissance-ou-transition-ecologique.md | 1+
Acontent/2020/mp/design-Ecologique.lua | 8++++++++
Acontent/2020/mp/design-Ecologique.md | 1+
Acontent/2020/mp/histoires-de-velos.lua | 8++++++++
Acontent/2020/mp/histoires-de-velos.md | 1+
Acontent/2020/mp/la-face-cachee-de-la-relance-verte.lua | 8++++++++
Acontent/2020/mp/la-face-cachee-de-la-relance-verte.md | 1+
Acontent/2020/mp/la-societe-des-plantes.lua | 8++++++++
Acontent/2020/mp/la-societe-des-plantes.md | 1+
Acontent/2020/mp/low-tech-lab.lua | 8++++++++
Acontent/2020/mp/low-tech-lab.md | 1+
Acontent/2020/mp/no-tech-magazine.lua | 8++++++++
Acontent/2020/mp/no-tech-magazine.md | 1+
Acontent/2020/mp/openbsd-handbook.lua | 8++++++++
Acontent/2020/mp/openbsd-handbook.md | 1+
Acontent/2020/mp/polemos.lua | 8++++++++
Acontent/2020/mp/polemos.md | 1+
Acontent/2020/mp/survival-of-the-richest.lua | 8++++++++
Acontent/2020/mp/survival-of-the-richest.md | 1+
Acontent/2020/mp/technologie-forestiere.lua | 8++++++++
Acontent/2020/mp/technologie-forestiere.md | 1+
Atemplates/navigation.html | 24++++++++++++++++++++++++
Atemplates/posttypes/article.html | 29+++++++++++++++++++++++++++++
Atemplates/posttypes/bookmark.html | 34++++++++++++++++++++++++++++++++++
Atemplates/posttypes/like.html | 32++++++++++++++++++++++++++++++++
Atemplates/posttypes/note-index.html | 33+++++++++++++++++++++++++++++++++
Atemplates/posttypes/note.html | 25+++++++++++++++++++++++++
Atemplates/posttypes/reply.html | 29+++++++++++++++++++++++++++++
Atemplates/posttypes/repost.html | 29+++++++++++++++++++++++++++++
Atodo.org | 12++++++++++++
38 files changed, 616 insertions(+), 0 deletions(-)

diff --git a/archetypes/bookmark.lua.mustache b/archetypes/bookmark.lua.mustache @@ -0,0 +1,8 @@ +return { +title = "{{ title }}", +url = "{{{ url }}}", +date = "{{ date }}", +datetime = "{{ datetime }}", +posttype = "bookmark", +keywords = { {{#keywords}}"{{.}}",{{/keywords}} } +} diff --git a/archetypes/bookmark.md.mustache b/archetypes/bookmark.md.mustache @@ -0,0 +1 @@ +<{{{ url }}}> diff --git a/bin/bookmark b/bin/bookmark @@ -0,0 +1,83 @@ +#!/usr/bin/env lua +do + -- + package.path = package.path .. ';'.. arg[0]:match("(.*/)") ..'/?.lua' + -- + local inspect = require 'inspect' + local lustache = require 'lustache' + local file = require 'utils.file' + local slugify = require 'utils.slugify' + + local bookmark_title + local bookmark_url + local bookmark_keywords + local bookmark_keywords_table = {} + local bookmark_lua_file + local bookmark_md_file + local bookmark_name + local bookmark_dir + + -- Set the title of the bookmark + repeat + io.write('Please enter the title of the bookmark: \n') + io.flush() + + bookmark_title=io.read() + + tostring(bookmark_title) + until string.len(bookmark_title) > 0 + + -- Set the url of the bookmark + repeat + io.write('Please enter the URL of the bookmark: \n') + io.flush() + + bookmark_url=io.read() + + tostring(bookmark_url) + until string.len(bookmark_url) > 0 + + -- Set the keywords of the bookmark + repeat + io.write('Please enter the KEYWORDS of the bookmark: \n') + io.flush() + + bookmark_keywords=io.read() + + tostring(bookmark_keywords) + until string.len(bookmark_keywords) > 0 + + -- Convert to table + for keyword in string.gmatch(bookmark_keywords, '([^,]+)') do + table.insert(bookmark_keywords_table, keyword) + end + + --print(inspect(table.pack(bookmark_keywords_table))) + + -- Set the structure of the data file + local bookmark_model = { + title = bookmark_title, + url = bookmark_url, + date = os.date('%Y-%m-%d'), + datetime = os.date('%H:%M:%S'), + posttype = "bookmark", + keywords = bookmark_keywords_table + } + + -- Render the markdown file + bookmark_md_file = lustache:render(file.read('archetypes/bookmark.md.mustache'), bookmark_model) + + -- Render the lua data file + bookmark_lua_file = lustache:render(file.read('archetypes/bookmark.lua.mustache'), bookmark_model) + bookmark_name = slugify(bookmark_title) + bookmark_dir = 'content/' .. os.date('%Y') .. '/mp/' + + -- Make the directory + file.mkdir(bookmark_dir) + -- Make the lua file + file.write(bookmark_dir .. bookmark_name .. '.lua', bookmark_lua_file) + -- Make the lua file + file.write(bookmark_dir .. bookmark_name .. '.md', bookmark_md_file) + + return +end diff --git a/bin/utils/file.lua b/bin/utils/file.lua @@ -0,0 +1,66 @@ +-- @module file +local file = {} +local lfs = require 'lfs' +local mimetypes = require 'mimetypes' +-- +-- Open & read the content of a file +function file.read(filepath) + local _file = assert(io.open(filepath, 'r')) + local content = _file:read '*a' + + _file:close() + + return content +end + +-- Create a file and add data in it +function file.write(filepath, data) + local _file = io.open(filepath, 'w+') + + _file:write(data) + _file:close() + + return assert(lfs.attributes(filepath).mode == 'file') +end + +-- Get basename from a file path +function file.get_basename(filepath) + return filepath:gsub('(.*/)(.*)', '%2') +end + +-- Get the directory of a file +function file.get_dirname(filepath) + return filepath:match("(.*/)") +end + +-- Get directory basename +function file.get_basedir(dirname) + return dirname:match('^.+/(.+)$') +end + +function file.get_relpath(filepath, dirname) + return filepath:sub((dirname):len() + 1) +end + +-- Check if the file is markdown +function file.is_markdown(filepath) + return (mimetypes.guess(filepath) == 'text/x-markdown') +end + +-- Check if the file is index.md +function file.is_index(filepath) + return (file.get_basename(filepath) == 'index.md') +end + +-- Create a dirtree +function file.mkdir(filepath) + local sep, pStr = package.config:sub(1, 1), '' + + for dir in filepath:gmatch('[^' .. sep .. ']+') do + pStr = pStr .. sep .. dir + + lfs.mkdir(lfs.currentdir() .. pStr) + end +end + +return file diff --git a/bin/utils/slugify.lua b/bin/utils/slugify.lua @@ -0,0 +1,106 @@ +--[[ + Lua Slugify + + Creating URL slugs properly in Lua (including transliteration for + UTF-8) + + "Original version in JavaScript" + <https://ourcodeworld.com/articles/read/255/creating-url-slugs-properly-in-javascript-including-transliteration-for-utf-8> +]]-- + +local charmap = { + -- Latin + ["À"] = "A", ["Á"] = "A", ["Â"] = "A", ["Ã"] = "A", ["Ä"] = "A", ["Å"] = "A", ["Æ"] = "AE", ["Ç"] = "C", + ["È"] = "E", ["É"] = "E", ["Ê"] = "E", ["Ë"] = "E", ["Ì"] = "I", ["Í"] = "I", ["Î"] = "I", ["Ï"] = "I", + ["Ð"] = "D", ["Ñ"] = "N", ["Ò"] = "O", ["Ó"] = "O", ["Ô"] = "O", ["Õ"] = "O", ["Ö"] = "O", ["Ő"] = "O", + ["Ø"] = "O", ["Ù"] = "U", ["Ú"] = "U", ["Û"] = "U", ["Ü"] = "U", ["Ű"] = "U", ["Ý"] = "Y", ["Þ"] = "TH", + ["ß"] = "ss", + ["à"] = "a", ["á"] = "a", ["â"] = "a", ["ã"] = "a", ["ä"] = "a", ["å"] = "a", ["æ"] = "ae", ["ç"] = "c", + ["è"] = "e", ["é"] = "e", ["ê"] = "e", ["ë"] = "e", ["ì"] = "i", ["í"] = "i", ["î"] = "i", ["ï"] = "i", + ["ð"] = "d", ["ñ"] = "n", ["ò"] = "o", ["ó"] = "o", ["ô"] = "o", ["õ"] = "o", ["ö"] = "o", ["ő"] = "o", + ["ø"] = "o", ["ù"] = "u", ["ú"] = "u", ["û"] = "u", ["ü"] = "u", ["ű"] = "u", ["ý"] = "y", ["þ"] = "th", + ["ÿ"] = "y", + -- Latin symbols + ["©"] = "(c)", + -- Greek + ["Α"] = "A", ["Β"] = "B", ["Γ"] = "G", ["Δ"] = "D", ["Ε"] = "E", ["Ζ"] = "Z", ["Η"] = "H", ["Θ"] = "8", + ["Ι"] = "I", ["Κ"] = "K", ["Λ"] = "L", ["Μ"] = "M", ["Ν"] = "N", ["Ξ"] = "3", ["Ο"] = "O", ["Π"] = "P", + ["Ρ"] = "R", ["Σ"] = "S", ["Τ"] = "T", ["Υ"] = "Y", ["Φ"] = "F", ["Χ"] = "X", ["Ψ"] = "PS", ["Ω"] = "W", + ["Ά"] = "A", ["Έ"] = "E", ["Ί"] = "I", ["Ό"] = "O", ["Ύ"] = "Y", ["Ή"] = "H", ["Ώ"] = "W", ["Ϊ"] = "I", + ["Ϋ"] = "Y", + ["α"] = "a", ["β"] = "b", ["γ"] = "g", ["δ"] = "d", ["ε"] = "e", ["ζ"] = "z", ["η"] = "h", ["θ"] = "8", + ["ι"] = "i", ["κ"] = "k", ["λ"] = "l", ["μ"] = "m", ["ν"] = "n", ["ξ"] = "3", ["ο"] = "o", ["π"] = "p", + ["ρ"] = "r", ["σ"] = "s", ["τ"] = "t", ["υ"] = "y", ["φ"] = "f", ["χ"] = "x", ["ψ"] = "ps", ["ω"] = "w", + ["ά"] = "a", ["έ"] = "e", ["ί"] = "i", ["ό"] = "o", ["ύ"] = "y", ["ή"] = "h", ["ώ"] = "w", ["ς"] = "s", + ["ϊ"] = "i", ["ΰ"] = "y", ["ϋ"] = "y", ["ΐ"] = "i", + -- Turkish + ["Ş"] = "S", ["İ"] = "I", ["Ç"] = "C", ["Ü"] = "U", ["Ö"] = "O", ["Ğ"] = "G", + ["ş"] = "s", ["ı"] = "i", ["ç"] = "c", ["ü"] = "u", ["ö"] = "o", ["ğ"] = "g", + -- Russian + ["А"] = "A", ["Б"] = "B", ["В"] = "V", ["Г"] = "G", ["Д"] = "D", ["Е"] = "E", ["Ё"] = "Yo", ["Ж"] = "Zh", + ["З"] = "Z", ["И"] = "I", ["Й"] = "J", ["К"] = "K", ["Л"] = "L", ["М"] = "M", ["Н"] = "N", ["О"] = "O", + ["П"] = "P", ["Р"] = "R", ["С"] = "S", ["Т"] = "T", ["У"] = "U", ["Ф"] = "F", ["Х"] = "H", ["Ц"] = "C", + ["Ч"] = "Ch", ["Ш"] = "Sh", ["Щ"] = "Sh", ["Ъ"] = "", ["Ы"] = "Y", ["Ь"] = "", ["Э"] = "E", ["Ю"] = "Yu", + ["Я"] = "Ya", + ["а"] = "a", ["б"] = "b", ["в"] = "v", ["г"] = "g", ["д"] = "d", ["е"] = "e", ["ё"] = "yo", ["ж"] = "zh", + ["з"] = "z", ["и"] = "i", ["й"] = "j", ["к"] = "k", ["л"] = "l", ["м"] = "m", ["н"] = "n", ["о"] = "o", + ["п"] = "p", ["р"] = "r", ["с"] = "s", ["т"] = "t", ["у"] = "u", ["ф"] = "f", ["х"] = "h", ["ц"] = "c", + ["ч"] = "ch", ["ш"] = "sh", ["щ"] = "sh", ["ъ"] = "", ["ы"] = "y", ["ь"] = "", ["э"] = "e", ["ю"] = "yu", + ["я"] = "ya", + -- Ukrainian + ["Є"] = "Ye", ["І"] = "I", ["Ї"] = "Yi", ["Ґ"] = "G", + ["є"] = "ye", ["і"] = "i", ["ї"] = "yi", ["ґ"] = "g", + -- Czech + ["Č"] = "C", ["Ď"] = "D", ["Ě"] = "E", ["Ň"] = "N", ["Ř"] = "R", ["Š"] = "S", ["Ť"] = "T", ["Ů"] = "U", + ["Ž"] = "Z", + ["č"] = "c", ["ď"] = "d", ["ě"] = "e", ["ň"] = "n", ["ř"] = "r", ["š"] = "s", ["ť"] = "t", ["ů"] = "u", + ["ž"] = "z", + -- Polish + ["Ą"] = "A", ["Ć"] = "C", ["Ę"] = "e", ["Ł"] = "L", ["Ń"] = "N", ["Ó"] = "o", ["Ś"] = "S", ["Ź"] = "Z", + ["Ż"] = "Z", + ["ą"] = "a", ["ć"] = "c", ["ę"] = "e", ["ł"] = "l", ["ń"] = "n", ["ó"] = "o", ["ś"] = "s", ["ź"] = "z", + ["ż"] = "z", + -- Latvian + ["Ā"] = "A", ["Č"] = "C", ["Ē"] = "E", ["Ģ"] = "G", ["Ī"] = "i", ["Ķ"] = "k", ["Ļ"] = "L", ["Ņ"] = "N", + ["Š"] = "S", ["Ū"] = "u", ["Ž"] = "Z", + ["ā"] = "a", ["č"] = "c", ["ē"] = "e", ["ģ"] = "g", ["ī"] = "i", ["ķ"] = "k", ["ļ"] = "l", ["ņ"] = "n", + ["š"] = "s", ["ū"] = "u", ["ž"] = "z", + -- -- Varia + -- ["@"] = "", +} + +local extend = function(list, ...) + local lists = {...} + + for i, source in ipairs(lists) do + for k, v in pairs(source) do + list[k] = source[k] + end + end + + return list +end + +local slugify = function(str, opt) + local defaults = { + separator = "-", + limit = nil, + customslug = nil + } + + local options = extend({}, defaults, opt) + local slug = str:lower() + + for k, v in pairs(charmap) do + slug = slug:gsub(tostring(k), charmap[k]) + end + + slug = (type(options.limit) == "number" and slug:sub(0, options.limit) or slug) + :gsub("%p", "") + :gsub("%s", options.separator) + :gsub(options.separator.."+", options.separator) + + return (type(options.customslug) == "string" and options.customslug or slug) +end + +return slugify diff --git a/content/2020/index.lua b/content/2020/index.lua @@ -0,0 +1,6 @@ +return { + date = "2020-11-05", + datetime = "21:53:00", + title = "Publications 2020", + posttype = "default-index" +} diff --git a/content/2020/index.md b/content/2020/index.md diff --git a/content/2020/mp/decroissance-ou-transition-ecologique.lua b/content/2020/mp/decroissance-ou-transition-ecologique.lua @@ -0,0 +1,8 @@ +return { + title = "Décroissance ou transition écologique?", + url = "https://plus.lapresse.ca/screens/5fe13635-dd23-4b58-98d5-bf33e7fc7e40__7C___0.html", + date = "2020-05-11", + datetime = "08:37:29", + posttype = "bookmark", + keywords = {"décroissance","écologie","covid19","lapresse"} +} diff --git a/content/2020/mp/decroissance-ou-transition-ecologique.md b/content/2020/mp/decroissance-ou-transition-ecologique.md @@ -0,0 +1 @@ +<https://plus.lapresse.ca/screens/5fe13635-dd23-4b58-98d5-bf33e7fc7e40__7C___0.html> diff --git a/content/2020/mp/design-Ecologique.lua b/content/2020/mp/design-Ecologique.lua @@ -0,0 +1,8 @@ +return { +title = "Design Écologique", +url = "https://designecologique.ca/", +date = "2020-11-05", +datetime = "21:33:33", +posttype = "bookmark", +keywords = { "permaculture","foretnourriciere","entreprise","horticulture", } +} diff --git a/content/2020/mp/design-Ecologique.md b/content/2020/mp/design-Ecologique.md @@ -0,0 +1 @@ +<https://designecologique.ca/> diff --git a/content/2020/mp/histoires-de-velos.lua b/content/2020/mp/histoires-de-velos.lua @@ -0,0 +1,8 @@ +return { +title = "[Histoires de vélos", +url = "https://www.tv5unis.ca/histoires-de-velos", +date = "2020-11-05", +datetime = "21:37:40", +posttype = "bookmark", +keywords = { "film","documentaire","vélo", } +} diff --git a/content/2020/mp/histoires-de-velos.md b/content/2020/mp/histoires-de-velos.md @@ -0,0 +1 @@ +<https://www.tv5unis.ca/histoires-de-velos> diff --git a/content/2020/mp/la-face-cachee-de-la-relance-verte.lua b/content/2020/mp/la-face-cachee-de-la-relance-verte.lua @@ -0,0 +1,8 @@ +return { +title = "La face cachée de la relance verte", +url = "https://grandrefus.wordpress.com/2020/06/04/face-cachee-relance-verte/", +date = "2020-11-05", +datetime = "21:40:00", +posttype = "bookmark", +keywords = { "décroissance","humeur","idée", } +} diff --git a/content/2020/mp/la-face-cachee-de-la-relance-verte.md b/content/2020/mp/la-face-cachee-de-la-relance-verte.md @@ -0,0 +1 @@ +<https://grandrefus.wordpress.com/2020/06/04/face-cachee-relance-verte/> diff --git a/content/2020/mp/la-societe-des-plantes.lua b/content/2020/mp/la-societe-des-plantes.lua @@ -0,0 +1,8 @@ +return { + title = "La société des plantes", + url = "https://www.lasocietedesplantes.com/", + date = "2020-07-05", + datetime = "09:02:46", + posttype = "bookmark", + keywords = { "Kamouraska","semence","semencier", } +} diff --git a/content/2020/mp/la-societe-des-plantes.md b/content/2020/mp/la-societe-des-plantes.md @@ -0,0 +1 @@ +<https://www.lasocietedesplantes.com/> diff --git a/content/2020/mp/low-tech-lab.lua b/content/2020/mp/low-tech-lab.lua @@ -0,0 +1,8 @@ +return { +title = "Low Tech Lab", +url = "https://lowtechlab.org/fr", +date = "2020-11-05", +datetime = "21:35:23", +posttype = "bookmark", +keywords = { "lowtech","howto","diy", } +} diff --git a/content/2020/mp/low-tech-lab.md b/content/2020/mp/low-tech-lab.md @@ -0,0 +1 @@ +<https://lowtechlab.org/fr> diff --git a/content/2020/mp/no-tech-magazine.lua b/content/2020/mp/no-tech-magazine.lua @@ -0,0 +1,8 @@ +return { +title = "NO TECH MAGAZINE", +url = "https://www.notechmagazine.com/", +date = "2020-07-05", +datetime = "08:58:07", +posttype = "bookmark", +keywords = { "lowtech","notech","blogue","magazine", } +} diff --git a/content/2020/mp/no-tech-magazine.md b/content/2020/mp/no-tech-magazine.md @@ -0,0 +1 @@ +<https://www.notechmagazine.com/> diff --git a/content/2020/mp/openbsd-handbook.lua b/content/2020/mp/openbsd-handbook.lua @@ -0,0 +1,8 @@ +return { + title = "OpenBSD Handbook !!!!!", + url = "https://www.openbsdhandbook.com/", + date = "2020-10-29", + datetime = "15:33:57", + posttype = "bookmark", + keywords = {"openbsd","documentation","unix"} +} diff --git a/content/2020/mp/openbsd-handbook.md b/content/2020/mp/openbsd-handbook.md @@ -0,0 +1 @@ +<https://www.openbsdhandbook.com/> diff --git a/content/2020/mp/polemos.lua b/content/2020/mp/polemos.lua @@ -0,0 +1,8 @@ +return { +title = "Polémos", +url = "https://polemos-decroissance.org", +date = "2020-11-05", +datetime = "21:44:09", +posttype = "bookmark", +keywords = { "décroissance","écologie","idée", } +} diff --git a/content/2020/mp/polemos.md b/content/2020/mp/polemos.md @@ -0,0 +1 @@ +<https://polemos-decroissance.org> diff --git a/content/2020/mp/survival-of-the-richest.lua b/content/2020/mp/survival-of-the-richest.lua @@ -0,0 +1,8 @@ +return { + title = "Survival of the Richest", + url = "https://onezero.medium.com/survival-of-the-richest-9ef6cddd0cc1", + date = "2020-07-05", + datetime = "08:51:12", + posttype = "bookmark", + keywords = { "richest","climat","écologie","milliardaires","riches"} +} diff --git a/content/2020/mp/survival-of-the-richest.md b/content/2020/mp/survival-of-the-richest.md @@ -0,0 +1 @@ +<https://onezero.medium.com/survival-of-the-richest-9ef6cddd0cc1> diff --git a/content/2020/mp/technologie-forestiere.lua b/content/2020/mp/technologie-forestiere.lua @@ -0,0 +1,8 @@ +return { +title = "Technologie forestière", +url = "https://www.cegep-ste-foy.qc.ca/programmes/programmes-techniques/technologie-forestiere/", +date = "2020-11-05", +datetime = "21:30:40", +posttype = "bookmark", +keywords = { "étude","cégep","dec", } +} diff --git a/content/2020/mp/technologie-forestiere.md b/content/2020/mp/technologie-forestiere.md @@ -0,0 +1 @@ +<https://www.cegep-ste-foy.qc.ca/programmes/programmes-techniques/technologie-forestiere/> diff --git a/templates/navigation.html b/templates/navigation.html @@ -0,0 +1,24 @@ +<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> +</nav> diff --git a/templates/posttypes/article.html b/templates/posttypes/article.html @@ -0,0 +1,29 @@ +<article class="h-entry"> + <h1 class="p-name"> + <%- title %> + </h1> + + <div class="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"/> + </a> + </p> + </footer> +</article> diff --git a/templates/posttypes/bookmark.html b/templates/posttypes/bookmark.html @@ -0,0 +1,34 @@ +<article class="h-entry hentry"> + <a class="u-bookmark-of" href="<%= url -%>" rel="external"> + <%- title -%> + </a> + + <% if keywords then %> + <ul> + <% for i, keyword in ipairs(keywords) do %> + <li><small><%- keyword -%></small></li> + <% end %> + </ul> + <% end %> + + + <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"/> + </a> + </p> + </footer> +</article> diff --git a/templates/posttypes/like.html b/templates/posttypes/like.html @@ -0,0 +1,32 @@ +<article class="h-entry"> + <p class="p-summary"> + Liked: + <a + class="u-like-of" + href="<%= content -%>" + rel="external"> + <%- content -%> + </a> + </p> + + <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"/> + </a> + </p> + </footer> +</article> +<!-- https://indieweb.org/like --> diff --git a/templates/posttypes/note-index.html b/templates/posttypes/note-index.html @@ -0,0 +1,33 @@ +<article class="h-entry hentry as-note"> + <div class="p-name 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> + <% 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 @@ -0,0 +1,25 @@ +<article class="h-entry hentry as-note"> + <div class="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"/> + </a> + </p> + </footer> +</article> diff --git a/templates/posttypes/reply.html b/templates/posttypes/reply.html @@ -0,0 +1,29 @@ +<article class="h-entry hentry"> + <a href="<%= replyto -%>" class="u-in-reply-to" rel="external"> + <%= replyto -%> + </a> + + <div class="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"/> + </a> + </p> + </footer> +</article> diff --git a/templates/posttypes/repost.html b/templates/posttypes/repost.html @@ -0,0 +1,29 @@ +<article class="h-entry"> + <a + class="u-repost-of" + href="<%= content -%>" + rel="external"> + <%- content -%> + </a> + + <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"/> + </a> + </p> + </footer> +</article> +<!-- https://indieweb.org/repost --> diff --git a/todo.org b/todo.org @@ -0,0 +1,12 @@ +* To doooooos + +** INPROGRESS Navigation +** TODO Export de fichiers static dans public_html/ +** TODO Compresser les images +** TODO Enlever les iframes, remplacer avec une autre technique +** TODO API +** TODO Juste utiliser lume, enlever Moses +** TODO Faire un rock pour luarocks +** TODO Terminer les templates +** TODO Shell scripts et lua scripts, pour créer rapidement du contenue ... ou avec Emacs? +** TODO Fournir dynamiquement certaines valeurs si une page n'a pas de data file .lua.