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 49efe0b7d388079e4c63583699cfde780110f70f
parent 746acbde2caa7d6ce37e637e9e64bc443a04bf72
Author: St John Karp <stjohn@fuzzjunket.com>
Date:   Sat, 27 Jun 2020 04:14:49 -0500

Remove one extra sed command by printing from find

Removed an extra sed command by printing the file names from find
without the starting point.

Diffstat:
Msqueeze.sh | 5++---
Munsqueeze.sh | 5++---
2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/squeeze.sh b/squeeze.sh @@ -12,10 +12,9 @@ rsync --archive --delete --verbose \ "$SOURCE_PATH/" "$OUTPUT_PATH/" # Parse and create all the HTML files. -find "$SOURCE_PATH" -type f -name "*.md" -print0 | - sed "s|$SOURCE_PATH/||g" | +find "$SOURCE_PATH" -type f -name "*.md" -printf "%P\0" | sed "s|\.md||g" | - xargs --null --max-procs 99 -I % sh -c "echo \"%\" && + xargs --null --max-procs 99 -I % sh -c "echo '%' && swipl --traditional --quiet -l parse_entry.pl -g \"consult('$SITE_PATH/site.pl'), generate_entry('$SOURCE_PATH/%.md').\" | smartypants \ > \"$OUTPUT_PATH/%.html\"" diff --git a/unsqueeze.sh b/unsqueeze.sh @@ -13,10 +13,9 @@ rsync --archive --delete --verbose \ "$OUTPUT_PATH/" "$SOURCE_PATH/" # Parse and create all the Markdown files. -find "$OUTPUT_PATH" -type f -name "*.html" -print0 | - sed "s|$OUTPUT_PATH/||g" | +find "$OUTPUT_PATH" -type f -name "*.html" -printf "%P\0" | sed "s|\.html||g" | - xargs --null --max-procs 99 -I % sh -c "echo \"%\" && + xargs --null --max-procs 99 -I % sh -c "echo '%' && swipl --traditional --quiet -l parse_entry.pl -g \"consult('$SITE_PATH/site.pl'), parse_entry('$OUTPUT_PATH/%.html').\" \ > \"$SOURCE_PATH/%.md\""