squeeze

A static site generator that can put the toothpaste back in the tube.
git clone https://git.stjo.hn/squeeze
Log | Files | Refs | README | LICENSE

commit 72c3ed75cb753dd6dadb6b367848559b51ba0c98
parent e9765f08a059b1becb966003efdca269bb20310f
Author: St John Karp <contact@stjo.hn>
Date:   Tue, 17 Sep 2019 05:31:37 -0500

Don't use protected name predicate

"name" turns out to be a system predicate, which can cause conflicts.
Renamed this DCG predicate, which fixes things right up.

Diffstat:
Mhtml.pl | 7+++----
Mreadme.md | 9++++-----
Mrss.pl | 7+++----
Mtastic.sh | 6+++---
4 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/html.pl b/html.pl @@ -234,9 +234,9 @@ br --> "<br />". license_text --> "Unless otherwise noted content on this website by <a href=\"mailto:", - email, + user_email, "\">", - name, + user_name, "</a> is licensed under a<br /><a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/3.0/\">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.". p_close --> "</p>". @@ -245,4 +245,4 @@ footer_close --> "</footer>". body_close --> "</body>". -html_close --> "</html>". -\ No newline at end of file +html_close --> "</html>". diff --git a/readme.md b/readme.md @@ -15,7 +15,7 @@ It's all reeeeeally alpha and is pretty closely tailored to my specific needs, b * Bash. Used to run the script that automates everything else. * A Prolog interpreter. Tested with [SWI-Prolog](https://www.swi-prolog.org/), but the syntax should be vanilla ISO Prolog and should work with any implementation. * [HTML Tidy](http://www.html-tidy.org/). Used to format the HTML output nicely — not something I relished doing in Prolog. -* [Smartypants](https://github.com/leohemsted/smartypants.py) located at ~/.local/bin/smartypants. Used to smarten the punctuation in the HTML output. +* [Smartypants](https://github.com/leohemsted/smartypants.py). Used to smarten the punctuation in the HTML output. ## Assumptions @@ -35,9 +35,9 @@ site.pl contains DCG definitions of this site's specifics, such as title, author site_url --> "https://www.example.com". - email --> "webmaster@example.com". + user_email --> "webmaster@example.com". - name --> "Harold Gruntfuttock". + user_name --> "Harold Gruntfuttock". ## Use @@ -51,4 +51,4 @@ Generate source files from a static website: ## Still to do -The source Markdown files are currently assumed to be plain HTML with a Markdown header containing metadata. I'm going to need something to convert proper Markdown to HTML, so I'll probably add Pandoc as a dependency to tastic.sh. I expect this will also replace Smartypants for doing smart punctuation. -\ No newline at end of file +The source Markdown files are currently assumed to be plain HTML with a Markdown header containing metadata. I'm going to need something to convert proper Markdown to HTML, so I'll probably add Pandoc as a dependency to tastic.sh. I expect this will also replace Smartypants for doing smart punctuation. diff --git a/rss.pl b/rss.pl @@ -67,7 +67,7 @@ copyright --> webmaster --> "<webMaster>", - email, + user_email, "</webMaster>". last_build_date(BuildDate) --> @@ -98,7 +98,7 @@ item_open --> "<item>". author --> "<author>", - name, + user_name, "</author>". pubdate(Date) --> @@ -111,4 +111,4 @@ item_close --> "</item>". rss_close --> "</channel>", "\n", - "</rss>". -\ No newline at end of file + "</rss>". diff --git a/tastic.sh b/tastic.sh @@ -49,8 +49,8 @@ then NEW_PATH=`echo "$file" | sed "s|^$SITE_PATH/$SOURCE_DIR|$SITE_PATH/$OUTPUT_DIR|" | sed 's|.md$|.html|'` cat "$file" | swipl --traditional -q -l parse_entry.pl -g "consult('$SITE_PATH/site.pl'), generate_entry." | - tidy -quiet --indent auto --indent-with-tabs yes --wrap 0 -asxml --tidy-mark no | - ~/.local/bin/smartypants \ + tidy5 -quiet --indent auto --indent-with-tabs yes --wrap 0 -asxml --tidy-mark no | + smartypants \ > "$NEW_PATH" done @@ -66,7 +66,7 @@ then ARTICLES=`grep -Rl --include=\*.md "^Date: " "$SITE_PATH"/"$SOURCE_DIR" | paste -sd ',' - | sed "s|,|','|g"` BUILD_DATE=`date +"%Y-%m-%d %T"` swipl --traditional -q -l generate_rss.pl -g "consult('$SITE_PATH/site.pl'), generate_rss(\"$BUILD_DATE\", ['$ARTICLES'])." | - tidy -quiet --indent auto --indent-with-tabs yes --wrap 0 -xml --tidy-mark no \ + tidy5 -quiet --indent auto --indent-with-tabs yes --wrap 0 -xml --tidy-mark no \ > "$SITE_PATH"/"$OUTPUT_DIR"/feeds/rss.xml else echo "Invalid argument."