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 a1ccb4a96e9d55b30e4672c0e43c483de57a89f1
parent 9c72dbdc6e4d2f281cf543afab85b5cf0a7b70d2
Author: St John Karp <contact@stjo.hn>
Date:   Mon, 19 Oct 2020 16:48:27 -0500

Key off the ID of the article date

Removed a few lines of code from the RSS generation by keying off
the ID of the article date element instead of looking for the Markdown
files and then figuring out where the HTML is.

Msqueeze.sh | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/squeeze.sh b/squeeze.sh @@ -18,16 +18,13 @@ find "$SOURCE_PATH" -type f -name "*.md" -printf "%P\0" | # Generate the RSS feed. mkdir -p "$OUTPUT_PATH/feeds" # Grep the date of each article. -ARTICLES=$(grep --recursive --include "*.md" "^Date: " "$SOURCE_PATH" | +ARTICLES=$(grep --recursive --include "*.html" "id=\"article-date\"" "$OUTPUT_PATH" | # Sort articles by date (skipping the first field). sort +1 | # Get the last (i.e. most recent) posts for the RSS feed. tail -5 | # Reformat to just the file names. cut --fields 1 --delimiter : | - # Convert paths so we operate on the generated HTML, not the unformatted Markdown. - sed "s|^$SOURCE_PATH|$OUTPUT_PATH|" | - sed 's|.md$|.html|' | # Glue the file names together to be passed to Prolog. paste --serial --delimiters ',' - | sed "s|,|','|g")