fakestache-ssg

[Archived] A static site generator in Bash 4.
Log | Files | Refs | Submodules | README

commit 4a8dcc40ca59cab8b6fb607c17eb4e953c3da8e7
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Mon, 31 Oct 2016 06:53:50 -0400

First commit.

Diffstat:
AREADME.md | 5+++++
Aarchetypes/note.md | 9+++++++++
Aconfig/config | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/.gitignore | 4++++
Afakestache | 91+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afunctions/build-pandoc-templates | 26++++++++++++++++++++++++++
Afunctions/clean-content-folder | 13+++++++++++++
Afunctions/create-html-pages | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afunctions/create-html-sections | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afunctions/get-archetypes | 13+++++++++++++
Afunctions/get-pandoc-templates | 14++++++++++++++
Afunctions/get-static-files | 8++++++++
Afunctions/move-html-to-publichtml | 8++++++++
Afunctions/parse_yaml | 19+++++++++++++++++++
Apublic_html/.gitignore | 4++++
Atemplates/mustache/curriculum-vitae.mustache | 36++++++++++++++++++++++++++++++++++++
Atemplates/mustache/default-index.inc.mustache | 8++++++++
Atemplates/mustache/default-index.mustache | 20++++++++++++++++++++
Atemplates/mustache/default.mustache | 24++++++++++++++++++++++++
Atemplates/mustache/feed/feed-entry.mustache | 10++++++++++
Atemplates/mustache/feed/feed.mustache | 11+++++++++++
Atemplates/mustache/index.mustache | 38++++++++++++++++++++++++++++++++++++++
Atemplates/mustache/note-index.inc.mustache | 32++++++++++++++++++++++++++++++++
Atemplates/mustache/note-index.mustache | 20++++++++++++++++++++
Atemplates/mustache/note.mustache | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atemplates/mustache/partials/footer.mustache | 8++++++++
Atemplates/mustache/partials/head.mustache | 30++++++++++++++++++++++++++++++
Atemplates/mustache/partials/nav.button.mustache | 13+++++++++++++
Atemplates/mustache/partials/nav.close.mustache | 9+++++++++
Atemplates/mustache/partials/nav.index.mustache | 27+++++++++++++++++++++++++++
Atemplates/mustache/partials/nav.mustache | 32++++++++++++++++++++++++++++++++
Atemplates/pandoc/.gitignore | 4++++
32 files changed, 814 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -0,0 +1,5 @@ +# FAKESTACHE SSG + +Yep! An Other Static Website Generator! + +Made with Pandoc, Mustache, Bash. diff --git a/archetypes/note.md b/archetypes/note.md @@ -0,0 +1,9 @@ +--- +title: {{ archetype_title }} +date: {{ archetype_date }} +datetime: {{ archetype_datetime }} +bridgy: true +--- +<!-- replyto: http://quelquechose.tld --> + +... diff --git a/config/config b/config/config @@ -0,0 +1,66 @@ +#!/bin/bash +# FakeStache SSG configuration file + +export NOW_DATE="$(date +%Y-%m-%d)" +export NOW_DATETIME="$(date +%H:%M:%S)" + +# Site configuration file +export SITE_DOMAINNAME="hugo.soucy.cc" +export SITE_URL="http://${SITE_DOMAINNAME}" +export SITE_URL_DEV="http://localhost:8181" +export SITE_LANGUAGE="fr" + +# Templates folders +export MUSTACHE=templates/mustache +export PANDOC=templates/pandoc + +# Archetypes folder (markdown files) +export ARCHETYPES=archetypes + +# Content folder (markdown files) +export CONTENT=content + +# Assets folder +export ASSETS=static/prod + +# Public HTML folder +export PUBLICHTML=public_html + +# PATHS +# To the current absolute path +export PANSTASH_PATH=$(pwd) + +# To the mustache templates +export TPL_MUSTACHE_PATH=$PANSTASH_PATH/$MUSTACHE + +# To the pandoc templates +export TPL_PANDOC_PATH=$PANSTASH_PATH/$PANDOC + +# To the archetypes files +export ARCHETYPES_PATH=$PANSTASH_PATH/$ARCHETYPES + +# To the content files +export CONTENT_PATH=$PANSTASH_PATH/$CONTENT + +# To the assets files +export ASSETS_PATH=$PANSTASH_PATH/$ASSETS + +# To the public_html folder +export PUBLICHTML_PATH=$PANSTASH_PATH/$PUBLICHTML + +# To the temporary folder +export TMP_PATH="/tmp" + +# Base URL +export BASE_URL=$SITE_URL + +# Metas +export SITE_DESCRIPTION="Développeur Web frontend ayant plus de 10 ans d'expérience dans le milieu des technologies de l'information. Il habite dans le quartier Limoilou à Québec." +export SITE_GENERATOR="Pandoc + (Mustache + Bash) = Panstash" + +export SITE_AUTHOR="Hugo Soucy" +export SITE_AUTHOR_TITLE="Développeur Web frontend" +export SITE_AUTHOR_EMAIL="hugo@soucy.cc" +export SITE_AUTHOR_PHONE="581-996-6481" +export SITE_AUTHOR_LOCALITY="Québec" +export SITE_AUTHOR_REGION="Qc" diff --git a/content/.gitignore b/content/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/fakestache b/fakestache @@ -0,0 +1,91 @@ +#!/bin/bash +# +# FAKESTACHE SSG - Yep! An Other Static Website Generator! +# (Pandoc + Mustache + Bash) +# + +# Dependencies : +# * Pandoc - Make sure it's installed on your machine : `$ pandoc -v`. +# * Mustache - Is already includes in pantash : `lib/mo/`. + +# Include the main configuration file +. config/config + +# Include mustache for bash +. lib/mo/mo + +# Include all the main functions +. functions/parse_yaml +. functions/get-archetypes +. functions/build-pandoc-templates +. functions/get-pandoc-templates +. functions/move-html-to-publichtml +. functions/create-html-pages +. functions/create-html-sections +. functions/get-static-files +. functions/clean-content-folder + +get_archetypes + +# Reset all variables that might be set +reset= + +case $1 in + "${archetypes[*]}") + if [ -n "$2" ]; then + archetype_title="$2" + archetype_date=$NOW_DATE + archetype_datetime=$NOW_DATETIME + + remove_whitespace=${archetype_title// /-} + remove_quote=${remove_whitespace//\'/-} + remove_capitalletter=${remove_quote,,} + + archetype_filename=${remove_capitalletter}.md + + mo $ARCHETYPES_PATH/$1.md > $CONTENT_PATH/$1/"$archetype_filename" + + echo "- The file '$CONTENT_PATH/$1/$archetype_filename' hab been created." + exit 0 + else + echo "- ERROR: Requires a second argument! You need a title to create a $1." >&2 + exit 1 + fi + ;; + -d|--dev) + BASE_URL=$SITE_URL_DEV + + case $2 in + -r|--reset) + reset=true + ;; + esac + ;; + -r|--reset) + reset=true + + case $2 in + -d|--dev) + BASE_URL=$SITE_URL_DEV + ;; + esac + ;; +esac + +if hash pandoc 2>/dev/null; then + # Ok Pandoc is here. + # Then execute main functions + build_pandoc_templates + create_html_pages "$reset" + create_html_sections + get_static_files + clean_content_folder + + echo "- Your New Website Is Ready Here : $PUBLICHTML_PATH/ . Thanks Pandoc!!" + exit 0 +else + echo "- Sorry But You must Install *Pandoc* For Using *FakeStache SSG*." + echo "- Please Visit <http://pandoc.org/installing.html>." + + exit 1 +fi diff --git a/functions/build-pandoc-templates b/functions/build-pandoc-templates @@ -0,0 +1,26 @@ +#!/bin/bash + +# Convert Mustache templates into Pandoc templates +build_pandoc_templates () { + echo "- Convert Mustache templates into Pandoc templates" + + # Purge the $TPL_PANDOC_PATH/ folder before the conversion + rm -Rf "$TPL_PANDOC_PATH/"*.html + + # HTML Templates + for mustache in "$TPL_MUSTACHE_PATH/"*.mustache; do + # Remove files path + mustachename=$(basename "$mustache") + # And then the convertion without the mustache extension + mo "$mustache" > "$TPL_PANDOC_PATH/${mustachename%.*}".html + done + # End + + # Feed Templates + for mustachefeed in "$TPL_MUSTACHE_PATH/feed/"*.mustache; do + # Remove files path + mustachefeedname=$(basename "$mustachefeed") + # And then the convertion without the mustache extension + mo "$mustachefeed" > "$TPL_PANDOC_PATH/${mustachefeedname%.*}".txt + done +} diff --git a/functions/clean-content-folder b/functions/clean-content-folder @@ -0,0 +1,13 @@ +#!/bin/bash + +# Then remove those in the content folder +clean_content_folder () { + echo "- Clean the content/ folder from all the HTML files" + + find "$CONTENT_PATH/" -name \*.html -type f -delete + + # After that remove empty directories + echo "- Clean the content/ folder from all the empty directories" + + find "$CONTENT_PATH/" -type d -empty -delete +} diff --git a/functions/create-html-pages b/functions/create-html-pages @@ -0,0 +1,77 @@ +#!/bin/bash + +# Create all the HTML pages with pandoc +create_html_pages () { + echo "- Create all the HTML pages with pandoc" + + get_pandoc_templates + + # Create the homepage + pandoc --template="$TPL_PANDOC_PATH/index.html" \ + -o "$CONTENT_PATH/index.html" "$CONTENT_PATH/index.md" + + case "$1" in + true) + find_noindex_markdown=$(find "$CONTENT_PATH/" -mindepth 2 -type f -name \*.md) + rm -R "$PUBLICHTML_PATH/"* + ;; + false) + find_noindex_markdown=$(find "$CONTENT_PATH/" -mindepth 2 -type f -name \*.md -mtime -1) + ;; + esac + + # Then create others + for markdown in $find_noindex_markdown; do + # Parent folder name without path + page_section=$(basename "$(dirname "$markdown")") + + # Markdown files names without path + outputname=$(basename "$markdown") + + # Parse the YAML block of the markdown + eval "$(parse_yaml "$markdown" "config_")" + + if [[ "$config_date" != "null" ]]; then + # Get year and month + year=${config_date:0:4} + month=${config_date:5:2} + + # First create year and month folders + mkdir -p "$(dirname "$markdown")"/"$year"/"$month" + fi + + page_path="$year"/"$month"/"${outputname%.*}" + + # Check if a section have a specific template or use the default template + if [[ " ${templates[*]} " == *" $page_section "* ]]; then + # Check if the date property value is not "null" + if [[ "$config_date" != "null" ]]; then + + pandoc -s "$markdown" \ + --template="$TPL_PANDOC_PATH/${page_section}.html" \ + --variable=modified:"$(date -r "$markdown" +%Y-%m-%dT%H:%M:%S)" \ + --variable=permalink:"$BASE_URL/$page_section/$page_path.html" \ + -o "$(dirname "$markdown")/$page_path.html" + else + pandoc -s "$markdown" \ + --template="$TPL_PANDOC_PATH/${page_section}.html" \ + -o "$(dirname "$markdown")/${outputname%.*}.html" + fi + + else + if [[ "$config_date" != "null" ]]; then + pandoc -s "$markdown" \ + --template="$TPL_PANDOC_PATH/default.html" \ + --variable=modified:"$(date -r "$markdown" +%Y-%m-%dT%H:%M:%S)" \ + --variable=permalink:"$BASE_URL/$page_section/$page_path.html" \ + -o "$(dirname "$markdown")/$page_path.html" + else + pandoc -s "$markdown" \ + --template="$TPL_PANDOC_PATH/default.html" \ + -o "$(dirname "$markdown")/${outputname%.*}.html" + fi + fi + done + + move_html_to_publichtml +} diff --git a/functions/create-html-sections b/functions/create-html-sections @@ -0,0 +1,76 @@ +#!/bin/bash + +# Create section page list +create_html_sections () { + echo "- Create section page list" + + get_pandoc_templates + + for indexsubdir in $(find "$CONTENT_PATH/" -mindepth 2 -name index.md -exec dirname {} \;); do + if [[ " ${templates[*]} " == *" $(basename "$indexsubdir") "* ]]; then + tplname="$(basename "$indexsubdir")" + else + tplname=default + fi + + # For each section page create a temporary "includes" folder + mkdir -p "$TMP_PATH/panstash/$(basename "$indexsubdir")" + + tmp_folder="$TMP_PATH/panstash/$(basename "$indexsubdir")" + + # For all markdown files that are not "index.md" + for markdown in $(find "$indexsubdir/" -type f \( -name "*.md" ! -name "index.md" \)); do + # Markdown files names without path + outputname="$(basename "$markdown")" + + # Parse the YAML block of the markdown + eval "$(parse_yaml "$markdown" "config_")" + + # Set the variable for the date + markdown_date="$config_date$config_datetime" + + # Set the variable for the URL + url=$(find "$PUBLICHTML/" -type f -name "${outputname%.*}".html;) + + # Create all the includes files that make up section page and put them into the "includes" folder + pandoc "$markdown" -s \ + --variable=url:"$BASE_URL/${url#*/}" \ + --template="$TPL_PANDOC_PATH/${tplname}-index.inc.html" \ + -t html5 \ + -o "$tmp_folder/$markdown_date-${outputname%.*}".inc.html + + pandoc "$markdown" -s \ + --variable=url:"$BASE_URL/${url#*/}" \ + --template="$TPL_PANDOC_PATH/feed-entry.txt" \ + -t plain \ + -o "$tmp_folder/$markdown_date-${outputname%.*}".entry.xhtml + done + + if test "$(ls -A "$tmp_folder/")"; then + # Sort all the includes files + # Create an HTML file with all the includes in descending order + pandoc -t html5 $(find "$tmp_folder/" -type f -name \*.inc.html | sort -nr) \ + -o "$tmp_folder/tmp.html" \ + --parse-raw + + # This is for the feed + pandoc -t html $(find "$tmp_folder/" -type f -name \*.entry.xhtml | sort -nr) \ + -o "$tmp_folder/tmp.feed.xhtml" \ + --parse-raw + + # Merge the "includes.html" and "index.md" to create the section page list + pandoc -t html5 "$indexsubdir/index.md" -s \ + --template="$TPL_PANDOC_PATH/${tplname}-index.html" \ + -A "$tmp_folder/tmp.html" \ + -o "$indexsubdir/index.html" + + # This is for the feed + pandoc -t html "$tmp_folder/tmp.feed.xhtml" -s \ + --template="$TPL_PANDOC_PATH/feed.txt" \ + -o "$PUBLICHTML/feed.$(basename "$indexsubdir").atom.xml" \ + --parse-raw + fi + done + + move_html_to_publichtml +} diff --git a/functions/get-archetypes b/functions/get-archetypes @@ -0,0 +1,13 @@ +#!/bin/bash + +# Create an array with archtypes names +get_archetypes () { + archetypes=() + + for archetype in $ARCHETYPES_PATH/*; do + # Template name without path + archetypename=$(basename "$archetype") + # Push templates names in the array + archetypes+=(${archetypename%.*}) + done +} diff --git a/functions/get-pandoc-templates b/functions/get-pandoc-templates @@ -0,0 +1,14 @@ +#!/bin/bash + +# Create an array with templates names +get_pandoc_templates () { + templates=() + + for template in $TPL_PANDOC_PATH/*; do + # Template name without path + templatename=$(basename "$template") + # Push templates names in the array + templates+=(${templatename%.*}) + done + # End +} diff --git a/functions/get-static-files b/functions/get-static-files @@ -0,0 +1,8 @@ +#!/bin/bash + +# Rsync the static files into the public_html/ folder +get_static_files () { + echo "- Rsync the static files into the public_html/ folder" + + rsync -avmh "$ASSETS_PATH/" "$PUBLICHTML_PATH/" +} diff --git a/functions/move-html-to-publichtml b/functions/move-html-to-publichtml @@ -0,0 +1,8 @@ +#!/bin/bash + +# Rsync all HTML files and folders to the public_html folder +move_html_to_publichtml () { + echo "- Rsync all HTML files and folders to the public_html/ folder" + + rsync -avmh --include='*.html' -f 'hide,! */' "$CONTENT_PATH/" "$PUBLICHTML_PATH/" +} diff --git a/functions/parse_yaml b/functions/parse_yaml @@ -0,0 +1,19 @@ +#!/bin/bash + +# Source: https://gist.github.com/pkuczynski/8665367#file-parse_yaml-sh + +parse_yaml() { + local prefix=$2 + local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') + sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ + -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | + awk -F$fs '{ + indent = length($1)/2; + vname[indent] = $2; + for (i in vname) {if (i > indent) {delete vname[i]}} + if (length($3) > 0) { + vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")} + printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3); + } + }' +} diff --git a/public_html/.gitignore b/public_html/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/templates/mustache/curriculum-vitae.mustache b/templates/mustache/curriculum-vitae.mustache @@ -0,0 +1,36 @@ +{{> partials/head.mustache }} + +<body class="cv" id="cv"> + {{> partials/nav.button.mustache }} + + <header class="cv__banner"> + <div class="layout"> + <h1 class="cv__title"> + <span class="visuallyhidden">Curriculum vitæ de</span> + <span class="logo">{{ SITE_AUTHOR }},</span> + </h1> + + <p class="cv__infos"> + <strong>{{ SITE_AUTHOR_TITLE }}</strong><br> + <strong>{{ SITE_AUTHOR_LOCALITY }}</strong>, {{ SITE_AUTHOR_REGION }}<br> + Téléphone: <a href="tel:+1{{ SITE_AUTHOR_PHONE }}">{{ SITE_AUTHOR_PHONE }}</a><br> + Courriel: <a href="mailto:{{ SITE_AUTHOR_EMAIL }}">{{ SITE_AUTHOR_EMAIL }}</a> + </p> + </div> + </header> + + <main class="cv__main"> + <div class="layout"> + $body$ + + <div class="cv__list"> + $for(include-after)$ + $include-after$ + $endfor$ + </div> + </div> + </main> + + {{> partials/nav.mustache }} +</body> +</html> diff --git a/templates/mustache/default-index.inc.mustache b/templates/mustache/default-index.inc.mustache @@ -0,0 +1,8 @@ +<li class="list__item h-entry hentry"> + <a class="list__link dt-published dt-updated u-url u-uid like-h2" + href="$url$" + rel="permalink"> + $title$ + </a> &mdash; + <time class="value" $if(datetime)$datetime="$date$T$datetime$"$endif$>$date$</time> +</li> diff --git a/templates/mustache/default-index.mustache b/templates/mustache/default-index.mustache @@ -0,0 +1,20 @@ +{{> partials/head.mustache }} + +<body id="list" class="list"> + {{> partials/nav.button.mustache }} + + <main> + <div class="layout"> + $body$ + + <ol class="list__list"> + $for(include-after)$ + $include-after$ + $endfor$ + </ol> + </div> + </main> + + {{> partials/nav.mustache }} +</body> +</html> diff --git a/templates/mustache/default.mustache b/templates/mustache/default.mustache @@ -0,0 +1,24 @@ +{{> partials/head.mustache }} + +<body id="single"> + {{> partials/nav.button.mustache }} + + <article class="h-entry hentry"> + <div class="layout e-content p-name single"> + <!-- Pandoc var --> + $body$ + </div> + + {{> partials/nav.mustache }} + + <footer> + <address class="layout"> + <hr/> + + <p><a class="note__link u-url u-uid u-syndication" href="#" rel="bookmark">#</a> Créé à {{ SITE_AUTHOR_LOCALITY }} le <time class="dt-published" $if(datetime)$datetime="$date$T$datetime$"$endif$>$date$</time> par <a class="p-author author" href="{{ BASE_URL }}#hs" rel="author"><i>{{ SITE_AUTHOR }}</i></a>. $if(modified)$Modifié le <time class="dt-updated">$modified$</time>.$endif$ + </p> + </address> + </footer> + </article> +</body> +</html> diff --git a/templates/mustache/feed/feed-entry.mustache b/templates/mustache/feed/feed-entry.mustache @@ -0,0 +1,10 @@ +<entry> + <title>$title$</title> + <link href="$url$" /> + <updated>$date$T$datetime$</updated> + + <author> + <name>{{ SITE_AUTHOR }}</name> + <email>{{ SITE_AUTHOR_EMAIL }}</email> + </author> +</entry> diff --git a/templates/mustache/feed/feed.mustache b/templates/mustache/feed/feed.mustache @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <title>Flux Atom de {{ SITE_DOMAINNAME }}</title> + <subtitle>{{ SITE_DESCRIPTION }}</subtitle> + <link href="{{ SITE_URL }}/feed.atom.xml" rel="self" /> + <link href="{{ SITE_URL }}" /> + <updated>{{ NOW_DATE }}T{{ NOW_DATETIME }}</updated> + + $body$ + <!-- End of the feed --> +</feed> diff --git a/templates/mustache/index.mustache b/templates/mustache/index.mustache @@ -0,0 +1,38 @@ +{{> partials/head.mustache }} + +<body id="index" prefix="foaf: http://xmlns.com/foaf/0.1/ dc: http://purl.org/dc/terms/"> + {{> partials/nav.button.mustache }} + + <div class="h-card" id="hs" resource="#hs" typeof="Person" vocab="http://schema.org/"> + <header> + <div class="layout"> + <h1 class="logo p-name" property="name">{{ SITE_AUTHOR }}</h1> + <h2 class="visuallyhidden p-job-title" property="jobTitle">{{ SITE_AUTHOR_TITLE }}</h2> + <a class="u-url visuallyhidden" href="{{ SITE_URL }}" rel="me">{{ SITE_URL }}</a> + </div> + </header> + + <main> + <div class="layout"> + <!-- Pandoc var --> + $body$ + </div> + </main> + + {{> partials/nav.index.mustache }} + + + <footer> + <address class="layout"> + <hr/> + Vous pouvez communiquer avec moi par courriel à + l'adresse <a href="mailto:{{ SITE_AUTHOR_EMAIL }}" rel="me"> + <span class="u-email" property="email">{{ SITE_AUTHOR_EMAIL }}</span></a>; + sinon vous pouvez également vous connecter au canal <abbr title="Inter Relay Chat">IRC</abbr> + <a href="irc://#htmlquebec@irc.freenode.net/">#htmlquebec</a> sur Freenode pour + me parler en direct. + </address> + </footer> + </div> +</body> +</html> diff --git a/templates/mustache/note-index.inc.mustache b/templates/mustache/note-index.inc.mustache @@ -0,0 +1,32 @@ +<li class="note__item h-entry hentry as-note"> + $if(citeurl)$ + <blockquote class="note__blockquote p-name e-content"> + <div class="note__blockquote__quote">$body$</div> + $if(cite)$ + <footer class="note__blockquote__footer"> + &mdash; + <cite class="note__blockquote__cite"> + <a href="$citeurl$" rel="external nofollow"> + $cite$ + </a> + </cite> + </footer> + $endif$ + </blockquote> + $else$ + <div class="note__blocknote p-name e-content"> + $body$ + </div> + $endif$ + <footer class="note__footer"> + Publié le + <a class="note__link u-url u-uid u-syndication" + $if(url)$ + href="$url$" + $endif$ + rel="syndication"> + <time class="dt-published dt-updated" $if(datetime)$datetime="$date$T$datetime$"$endif$>$date$</time> + </a>. + <span class="visuallyhidden">par <em class="p-author author">{{ SITE_AUTHOR }}</em></span> + </footer> +</li> diff --git a/templates/mustache/note-index.mustache b/templates/mustache/note-index.mustache @@ -0,0 +1,20 @@ +{{> partials/head.mustache }} + +<body id="note" class="note"> + {{> partials/nav.button.mustache }} + + <main> + <div class="layout"> + $body$ + + <ol class="note__list"> + $for(include-after)$ + $include-after$ + $endfor$ + </ol> + </div> + </main> + + {{> partials/nav.mustache }} +</body> +</html> diff --git a/templates/mustache/note.mustache b/templates/mustache/note.mustache @@ -0,0 +1,59 @@ +{{> partials/head.mustache }} + +<body id="note" class="note"> + <main> + <article class="layout h-entry hentry as-note"> + <div class="layout__vcenter"> + <h1 class="visuallyhidden">$title$</h1> + + $if(citeurl)$ + <blockquote class="note__blockquote p-name e-content"> + <div class="note__blockquote__quote">$body$</div> + $if(cite)$ + <footer class="note__blockquote__footer"> + &mdash; + <cite class="note__blockquote__cite"> + <a href="$citeurl$" rel="external nofollow"> + $cite$ + </a> + </cite> + </footer> + $endif$ + </blockquote> + $else$ + <div class="note__blocknote p-name e-content"> + $body$ + </div> + $endif$ + + <footer class="note__footer"> + $if(permalink)$ + <a class="note__link u-url u-uid u-syndication bookmark" + href="$permalink$" + rel="bookmark">#</a> + $endif$ + + $if(replyto)$ + <a class="note__link u-in-reply-to" + href="$replyto$" + rel="in-reply-to">En réponse à $replyto$.</a><br/> + $endif$ + + Publié le <time class="dt-published" $if(datetime)$datetime="$date$T$datetime$"$endif$>$date$</time> + par <a class="p-author author" href="{{ SITE_URL }}#hs" rel="author"><i>{{ SITE_AUTHOR }}</i></a> + $if(modified)$et modifié le <time class="dt-updated">$modified$</time>$endif$. + <br/>&crarr; <a href="{{ SITE_URL }}/note">Retourner aux notes</a>. + </footer> + </div> + $if(bridgy)$ + <a class="visuallyhidden" href="https://brid.gy/publish/twitter"></a> + $endif$ + </article> + </main> + + {{> partials/nav.mustache }} + + <!-- <script src="{{ BASE_URL }}/js/vendor/atomic.min.js"></script> + <script src="{{ BASE_URL }}/js/script.js"></script> --> +</body> +</html> diff --git a/templates/mustache/partials/footer.mustache b/templates/mustache/partials/footer.mustache @@ -0,0 +1,8 @@ +<footer id="footer"> + <address class="layout"> + <hr> + + <p>Page Web conçue par <a rel="author" href="{{ BASE_URL }}#hs">{{ SITE_AUTHOR }}</a> &amp; + propulsée par HTML 5, <a href="https://www.w3.org/2012/pyRdfa/extract?uri=http%3A%2F%2Fhugo.soucy.cc%2F%23hs&format=xml&rdfagraph=output&vocab_expansion=false&rdfa_lite=false&embedded_rdf=true&space_preserve=true&vocab_cache=true&vocab_cache_report=false&vocab_cache_refresh=false">RDFa</a> &amp; un générateur de site statique fait maison. <br>Dernière modification à {{ SITE_AUTHOR_LOCALITY }} le <time datetime="{{ NOW_DATE }}T{{ NOW_DATETIME }}">{{ NOW_DATE }}</time>.</p> + </address> +</footer> diff --git a/templates/mustache/partials/head.mustache b/templates/mustache/partials/head.mustache @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html lang="{{ SITE_LANGUAGE }}"> + <head> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> + <title>$pagetitle$ &mdash; {{ SITE_DOMAINNAME }}</title> + + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <script src="{{ BASE_URL }}/js/vendor/modernizr-3.3.1-custom.min.js"></script> + <link rel="stylesheet" href="{{ BASE_URL }}/css/styles.css" /> + + <!-- webmention.io --> + <link rel="pingback" href="https://webmention.io/hugo.soucy.cc/xmlrpc" /> + <link rel="webmention" href="https://webmention.io/hugo.soucy.cc/webmention" /> + + <link rel="me" href="http://shr.soucy.cc/" /> + <link rel="me" href="https://bandcamp.com/hs0ucy" /> + <link rel="me" href="https://framasphere.org/u/hs0ucy" /> + <link rel="me" href="http://twitter.com/hs0ucy" /> + <link rel="me" href="https://github.com/hs0ucy" /> + <link rel="me" href="sms:+15819966481" /> + + <link href="{{ BASE_URL }}/feed.note.atom.xml" type="application/atom+xml" rel="alternate" title="Feed des notes" /> + <link href="{{ BASE_URL }}/feed.txt.atom.xml" type="application/atom+xml" rel="alternate" title="Feed des textes" /> + + <meta name="robots" content="noindex, nofollow" /> + <meta name="description" content="{{ SITE_DESCRIPTION }}" /> + <meta name="author" content="{{ SITE_AUTHOR }}" /> + <meta name="generator" content="{{ SITE_GENERATOR }}" /> + </head> diff --git a/templates/mustache/partials/nav.button.mustache b/templates/mustache/partials/nav.button.mustache @@ -0,0 +1,13 @@ + + +<div class="layout"> + <a class="nav-button" href="#menu"> + <span class="nav-button__text"> + Menu <span class="visuallyhidden">principal</span> + </span> + + <span class="nav-button__burger"> + <i class="nav-button__burger__ico"></i> + </span> + </a> +</div> diff --git a/templates/mustache/partials/nav.close.mustache b/templates/mustache/partials/nav.close.mustache @@ -0,0 +1,9 @@ +<a class="nav__close" href="#" role="button"> + <span class="nav__close__text"> + Fermer <span class="visuallyhidden">le menu</span> + </span> + + <span class="nav__x"> + <i class="nav__x__ico"></i> + </span> +</a> diff --git a/templates/mustache/partials/nav.index.mustache b/templates/mustache/partials/nav.index.mustache @@ -0,0 +1,27 @@ +<nav class="nav"> + <div class="nav__panel" id="menu" tabindex="0"> + <div class="nav__panel__content layout"> + <h2 class="visuallyhidden">Navigation</h2> + + <ul class="nav__list" role="menubar"> + <li class="nav__item"> + <a class="nav__link" href="{{ BASE_URL }}/note"> + Notes + </a> + </li> + <li class="nav__item"> + <a class="nav__link" href="{{ BASE_URL }}/txt"> + Textes + </a> + </li> + <li class="nav__item"> + <a class="nav__link" href="{{ BASE_URL }}/file/curriculum-vitae"> + Curriculum vitae + </a> + </li> + </ul> + </div> + + {{> nav.close.mustache }} + </div> +</nav> diff --git a/templates/mustache/partials/nav.mustache b/templates/mustache/partials/nav.mustache @@ -0,0 +1,32 @@ +<nav class="nav"> + <div class="nav__panel" id="menu" tabindex="0"> + <div class="nav__panel__content layout"> + <h2 class="visuallyhidden">Navigation</h2> + + <ul class="nav__list" role="menubar"> + <li class="nav__item"> + <a class="nav__link" href="{{ BASE_URL }}" rel="index"> + Page d'accueil + </a> + </li> + <li class="nav__item"> + <a class="nav__link" href="{{ BASE_URL }}/note"> + Notes + </a> + </li> + <li class="nav__item"> + <a class="nav__link" href="{{ BASE_URL }}/txt"> + Textes + </a> + </li> + <li class="nav__item"> + <a class="nav__link" href="{{ BASE_URL }}/file/curriculum-vitae"> + Curriculum vitae + </a> + </li> + </ul> + </div> + + {{> nav.close.mustache }} + </div> +</nav> diff --git a/templates/pandoc/.gitignore b/templates/pandoc/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore