#!/bin/sh # # Ligne complète pour pandoc: # pandoc --template=lib/template.html -c lib/pandoc.css -H lib/head.html -B lib/header.html -A lib/footer.html "$mdfile" -o "$htmlfile" MARKDOWN_FILES=$(find content -name \*.md) FEED_FILE=content/feed.xml KEYWORDS=keywords.md cat "" > $KEYWORDS echo "## Generate HTML files for each markdown files" for mdfile in $MARKDOWN_FILES; do htmlfile="${mdfile%%.*}.html" if [ ! -f "$htmlfile" ] || [ "$htmlfile" -ot "$mdfile" ]; then echo "--> generate with pandoc '$htmlfile' from '$mdfile'" pandoc --template=lib/template.html -c lib/pandoc.css "$mdfile" -o "$htmlfile" fi pandoc --template=lib/extract-keywords.md "$mdfile" >> $KEYWORDS done echo "## END" echo "## Build keywords pages" python build_theme_index.py if [ ! -f "$htmlfile" ] || [ "$htmlfile" -ot "$mdfile" ]; then echo "--> generate with pandoc '$htmlfile' from '$mdfile'" pandoc --template=lib/template.html -c lib/pandoc.css "$mdfile" -o "$htmlfile" fi echo "## END" echo "## Build atom" LAST_CHANGES=$(git log --pretty="format:" --name-only | grep "content/*" | grep ".html" | uniq | tac | head -10) echo "liste des 10 derniers fichiers qui ont changés : $LAST_CHANGES" ITEMS="" for change in $LAST_CHANGES do titre=$(awk -F"

|

" '{for(i=2;i<=NF;i+=2){print $i}}' RS="" $change) lien=https://elsif.fr/$(echo $change | awk '{gsub(/content\//, ""); print $1}') updated=$(date -Ins -r $change) #summary=$(xmllint --html --noent --xpath "//article" $change) summary="" ITEMS="$ITEMS $titre$updatedtag:$(shasum $change | awk -F ' ' '{print $1}')$summaryYannick Françoisyaf@elsif.fr " done cat << EOF > $FEED_FILE Elsif.fr - Yannick François les dernières mise à jour du site tag:elsif.fr $(date -R) $ITEMS EOF exit 0