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 7bc5209b5dc13bd66e20cbc2ff1d6c5a438324bc
parent 19d89625662b87aef58679542bfb93a705901acd
Author: St John Karp <stjohn@fuzzjunket.com>
Date:   Sat, 20 Jun 2020 21:08:45 -0500

Remove some unnecessary logic from the RSS block

Removed some logic that's not necessary when using the correct
command arguments.

Diffstat:
Msqueeze.sh | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/squeeze.sh b/squeeze.sh @@ -37,14 +37,12 @@ find "$SOURCE_PATH" -type f -name "*.md" | mkdir -p "$OUTPUT_PATH/feeds" # Grep the date of each article. ARTICLES=$(grep --recursive --include=\*.md "^Date: " "$SOURCE_PATH" | - # Reformat the output so the date comes first, then the file name. - sed --quiet --regexp-extended 's/^([^:]+):(.+)$/\2\t\1/p' | - # Sort articles by date. - sort | - # Reformat to just the file names. - cut --fields=2 | + # 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|' |