hugosoucycc

[ARCHIVED] Another old source code of <hugo.soucy.cc>.
Log | Files | Refs | Submodules

commit 5435f851a139949bff7824b5ee3b83727b4e2cfd
parent ce3fdd31710cf70c68c79c2a99f8d514b98984f6
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Tue, 14 Mar 2017 19:17:25 -0400

Merge branch 'master' of github.com:hs0ucy/hugosoucycc

Diffstat:
Mfakestache | 22+++++++++++++++++++---
Mtemplates/mustache/default.mustache | 69+++++++++++++++++++++++++++++++++++++++++----------------------------
Mtemplates/mustache/partials/head.mustache | 3+--
3 files changed, 61 insertions(+), 33 deletions(-)

diff --git a/fakestache b/fakestache @@ -44,12 +44,12 @@ case $1 in archetype_title_nospecials=${archetype_title//[\'!,:;?]/} archetype_filename=${archetype_title_nospecials// /-}.md - mkdir -p "$CONTENT_PATH/$1/${NOW_DATE:0:4}/${NOW_DATE:5:2}/" + mkdir -p "$CONTENT_PATH/$1/${NOW_DATE:0:4}/${NOW_DATE:5:2}/" mo $ARCHETYPES_PATH/$1.md > "$CONTENT_PATH/$1/${NOW_DATE:0:4}/${NOW_DATE:5:2}/${archetype_filename,,}" echo "- The file '$CONTENT_PATH/$1/${NOW_DATE:0:4}/${NOW_DATE:5:2}/${archetype_filename,,}' hab been created." - + exit 0 else echo "- ERROR: Requires a second argument! You need a title to create a $1." >&2 @@ -57,20 +57,36 @@ case $1 in fi ;; -d|--dev) + # In dev mode the URL is localhost BASE_URL=$SITE_URL_DEV + # In dev mode the site is build in `/tmp` + PUBLICHTML_PATH=$TMP_PATH/$PUBLICHTML + case $2 in -r|--reset) reset=true ;; esac + + # Open the dev mode site in the default browser + # @todo But the server comment missing + #$BROWSER $BASE_URL ;; -r|--reset) reset=true case $2 in -d|--dev) + # In dev mode the URL is localhost BASE_URL=$SITE_URL_DEV + + # In dev mode the site is build in `/tmp` + PUBLICHTML_PATH=$TMP_PATH/$PUBLICHTML + + # Open the dev mode site in the default browser + # @todo But the server comment missing + #$BROWSER $BASE_URL ;; esac ;; @@ -88,7 +104,7 @@ if hash pandoc 2>/dev/null && (( ${BASH_VERSION%%.*} >= 4 )); then echo "- Your New Website Is Ready Here : $PUBLICHTML_PATH/ . Thanks Pandoc!!" exit 0 -else +else echo "- Sorry But You must Install *Pandoc* and/or have Bash >= 4 To Using *FakeStache SSG*." echo "- Please Visit <http://pandoc.org/installing.html>." diff --git a/templates/mustache/default.mustache b/templates/mustache/default.mustache @@ -1,37 +1,50 @@ {{> 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.button.mustache }} + + <article class="h-entry hentry"> + <div class="layout e-content p-name single"> + <!-- Pandoc var --> + $body$ + </div> - {{> partials/nav.mustache }} + {{> partials/nav.mustache }} - <footer> - <address class="layout"> - <hr/> - <p> - <a class="note__link u-url u-uid u-syndication" href="$permalink$" rel="bookmark">#</a> - Créé à {{ SITE_AUTHOR_LOCALITY }} le - <time class="dt-published" $if(datetime)$datetime="$date$T$datetime$"$endif$>$date$</time> par + <footer> + <address class="layout"> + <hr/> + <p> + <a class="note__link u-url u-uid u-syndication" href="$permalink$" 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 h-card" href="{{ SITE_URL }}#hs" rel="author"> - <i>{{ SITE_AUTHOR }}</i> - <img alt="" - class="u-photo visuallyhidden" - src="http://assets.soucy.cc/images/hugosoucy/favicon/hs-autoportrait-2010-nb-favion-32x32.png"/> - </a>. + <a class="p-author author h-card" href="{{ SITE_URL }}#hs" rel="author"> + <i>{{ SITE_AUTHOR }}</i> + <img alt="" + class="u-photo visuallyhidden" + src="http://assets.soucy.cc/images/hugosoucy/favicon/hs-autoportrait-2010-nb-favion-32x32.png"/> + </a>. - $if(modified)$Modifié le <time class="dt-updated">$modified$</time>.$endif$ - </p> - </address> - </footer> - </article> - - {{> partials/bottom-script.mustache }} + $if(modified)$Modifié le <time class="dt-updated">$modified$</time>.$endif$ + </p> + </address> + </footer> + + <aside> + <script id="webmention-hosted"> + (function () { + var sn = document.createElement("script"), s = document.getElementsByTagName("script")[0], url; + url = document.querySelectorAll ? document.querySelectorAll("link[rel~=canonical]") : false; + url = url && url[0] ? url[0].href : false; + sn.type = "text/javascript"; sn.async = true; + sn.src = "//webmention.herokuapp.com/api/embed?url=" + encodeURIComponent(url || window.location); + s.parentNode.insertBefore(sn, s); + }()); + </script> + </aside> + </article> + + {{> partials/bottom-script.mustache }} </body> </html> diff --git a/templates/mustache/partials/head.mustache b/templates/mustache/partials/head.mustache @@ -10,8 +10,7 @@ <link rel="stylesheet" href="{{ BASE_URL }}/css/styles.min.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="webmention" href="https://webmention.io/hugo.soucy.cc/webmention" /> <link rel="webmention" href="https://webmention.herokuapp.com/api/webmention" /> <link rel="me" href="http://shr.soucy.cc/" />