squeeze

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

commit eed5cbb2d819ddab54df63fd8a1ef17a6331ae08
parent 0d675aa3ca8b9f260642dcad87a12f3d6dedd277
Author: St John Karp <contact@stjo.hn>
Date:   Sun, 29 Aug 2021 08:33:36 -0400

Make some minor style tweaks to the shell scripts

Should result in no functional changes.

Diffstat:
Msqueeze.sh | 16++++++++--------
Munsqueeze.sh | 2+-
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/squeeze.sh b/squeeze.sh @@ -18,11 +18,11 @@ rsync --archive --delete --verbose \ # Parse and create all the HTML files. find "$SOURCE_PATH" -type f -name "*.md" | sed "s|$SITE_PATH/source/||g" | - while IFS= read -r file; do + while IFS= read -r file ; do echo "$file" # Get everything after the metadata. - if head -n 1 "$SOURCE_PATH/$file" | grep -q "^[A-Za-z]*: "; then + if head -n 1 "$SOURCE_PATH/$file" | grep -q "^[A-Za-z]*: " ; then HEADERS="$(sed '/^$/q' "$SOURCE_PATH/$file")" MARKDOWN="$(sed '1,/^$/d' "$SOURCE_PATH/$file")" else @@ -37,14 +37,14 @@ find "$SOURCE_PATH" -type f -name "*.md" | ([ ! -z "$HEADERS" ] && printf '%s\n\n' "$HEADERS" ; cat) | swipl --traditional --quiet -l parse_entry.pl -g "consult('$SITE_PATH/site.pl'), generate_entry." | # Unwrap block-level elements that have erroneously been wrapped in <p> tags. - sed "s|<p><details|<details|g" | - sed "s|</summary></p>|</summary>|g" | - sed "s|<p></details></p>|</details>|g" | - sed "s|<p><figure|<figure|g" | - sed "s|</figure></p>|</figure>|g" | + sed 's|<p><details|<details|g' | + sed 's|</summary></p>|</summary>|g' | + sed 's|<p></details></p>|</details>|g' | + sed 's|<p><figure|<figure|g' | + sed 's|</figure></p>|</figure>|g' | # Smarten punctuation. smartypants \ - > "$SITE_PATH/output/${file%%.md}.html" & + > "$OUTPUT_PATH/${file%%.md}.html" & done # Wait until all jobs have completed. diff --git a/unsqueeze.sh b/unsqueeze.sh @@ -19,7 +19,7 @@ rsync --archive --delete --verbose \ # Parse and create all the Markdown files. find "$OUTPUT_PATH" -type f -name "*.html" | sed "s|$SITE_PATH/output/||g" | - while IFS= read -r file; do + while IFS= read -r file ; do echo "$file" swipl --traditional --quiet -l parse_entry.pl -g "consult('$SITE_PATH/site.pl'), parse_entry('$SITE_PATH/output/$file')." |