diff --git a/engine/mk-index.sh b/engine/mk-index.sh index d6cc7db..d424cf9 100755 --- a/engine/mk-index.sh +++ b/engine/mk-index.sh @@ -6,17 +6,8 @@ webdir="_site" postsdir="$webdir/posts" indexfile="$webdir/index.html" -# maximal number of articles to put in the RSS file -maxarticles=100 - -# RSS Metas -rsstitle="her.esy.fun" -rssurl="https://her.esy.fun/rss.xml" -websiteurl="https://her.esy.fun" -rssdescription="her.esy.fun articles, mostly random personal thoughts" -rsslang="en" -rssauthor="yann@esposito.host (Yann Esposito)" -rssimgurl="https://her.esy.fun/img/FlatAvatar.png" +# maximal number of articles to put in the index homepage +maxarticles=1000 # HTML Accessors (similar to CSS accessors) dateaccessor='.yyydate' @@ -31,7 +22,6 @@ formatdate() { # echo "DEBUG DATE: $d" >&2 LC_TIME=en_US date --date $d +'%a, %d %b %Y %H:%M:%S %z' } - finddate(){ < $1 hxselect -c $dateaccessor | sed 's/\[//g;s/\]//g;s/ .*$//' } findtitle(){ < $1 hxselect -c $titleaccessor } getcontent(){ @@ -45,7 +35,6 @@ mkcategories(){ } autoload -U colors && colors - tmpdir=$(mktemp -d) typeset -a dates dates=( ) @@ -66,7 +55,6 @@ for fic in $postsdir/**/*.html; do keywords=( $(findkeywords $xfic) ) printf ": %-55s" "$title ($keywords)" categories=$(mkcategories $keywords) - absoluteurl="${websiteurl}/${blogfile}" { printf "\\n
  • " printf "\\n%s" "${blogfile}" "$title" printf "\\n%s%s" "$d" @@ -76,84 +64,84 @@ for fic in $postsdir/**/*.html; do dates=( $d $dates ) echo " [${fg[green]}OK${reset_color}]" done + echo "Publishing" + +# building the body + +{ cat < +Home | +Slides | +About + +(code +bookmarks +notes) + + +EOF +} >> $tmpdir/index + +previousyear="" for fic in $(ls $tmpdir/*.index | sort -r | head -n $maxarticles ); do echo "${fic:t}" + year=$( echo "${fic:t}" | perl -pe 's#(\d{4})-.*#$1#') + if (( year != previousyear )); then + echo $year + if (( previousyear > 0 )); then + echo "" >> $tmpdir/index + fi + previousyear=$year + echo "

    ${year}