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 e346feb2bad108d63cb431affafefe43e4990f75
parent 2edbb825831832d2ce7c70d7526c049b88582c61
Author: St John Karp <stjohn@mulligrubs.me>
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")