hugosoucycc

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

commit 141dc311e8f9b20f5fbd1a2189a8b40844e9f756
parent f685db4e3edb70b69f58deb02c3c549112e3b417
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sat, 11 Mar 2017 16:19:32 -0500

Generate an URI ID for the Atom feed.

Diffstat:
Mfunctions/create-feed | 1+
Mfunctions/create-html-pages | 5++++-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/functions/create-feed b/functions/create-feed @@ -7,6 +7,7 @@ create_feed () { field_datetime=$(echo $feed_entry | cut -d "|" -f 2) field_permalink=$(echo $feed_entry | cut -d "|" -f 3) field_title=$(echo $feed_entry | cut -d "|" -f 4) + field_id=$(echo $feed_entry | cut -d "|" -f 5) mo "$TPL_MUSTACHE_PATH/feed/feed-entry.mustache" diff --git a/functions/create-html-pages b/functions/create-html-pages @@ -35,6 +35,9 @@ create_html_pages () { # Get the relative path of the markdown file page_path="$(realpath --relative-to=$CONTENT_PATH $markdown)" + # Create an unique ID for each content + page_id="tag:$SITE_DOMAINNAME,${config_date}:${config_date:0:4}/${config_date:5:2}/${outputname%.*}" + # Check if a section have a specific template or use the default template if [[ " ${templates[*]} " == *" $templatename "* ]]; then pandoc -s "$markdown" \ @@ -52,7 +55,7 @@ create_html_pages () { -o "$(dirname "$markdown")/${outputname%.*}.html" fi - echo "$config_date|$config_datetime|$BASE_URL/${page_path%.*}.html|$config_title" + echo "$config_date|$config_datetime|$BASE_URL/${page_path%.*}.html|$config_title|$page_id" done | sort -nr -o "$FAKESTACHE_PATH"/"$DB" move_html_to_publichtml