From bf2387bb68d1698f684987f4207e1e04a3f08cee Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Tue, 25 May 2021 10:25:11 +0200 Subject: [PATCH] Link my old archives --- Makefile | 4 +++- engine/auto-build.sh | 2 +- engine/mk-index.sh | 17 ++++++--------- src/css/y.css | 8 ++++--- templates/index.html | 51 ++++++++++++++++++++++++++++++++++++++++++++ templates/post.html | 2 +- 6 files changed, 68 insertions(+), 16 deletions(-) create mode 100644 templates/index.html diff --git a/Makefile b/Makefile index 7d552a1..b4fade7 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,8 @@ ALL += indexcache # HTML INDEX HTML_INDEX := $(DST_DIR)/index.html MKINDEX := engine/mk-index.sh -$(HTML_INDEX): $(DST_XML_FILES) $(MKINDEX) $(TEMPLATE) +INDEX_TEMPLATE ?= templates/index.html +$(HTML_INDEX): $(DST_XML_FILES) $(MKINDEX) $(INDEX_TEMPLATE) @mkdir -p $(DST_DIR) $(MKINDEX) .PHONY: index @@ -85,6 +86,7 @@ MKRSS := engine/mkrss.sh $(RSS): $(DST_RSS_FILES) $(MKRSS) $(MKRSS) ALL += $(RSS) + .PHONY: rss rss: $(DST_RSS_FILES) $(RSS) ALL += rss diff --git a/engine/auto-build.sh b/engine/auto-build.sh index 6067e3d..b2b1845 100755 --- a/engine/auto-build.sh +++ b/engine/auto-build.sh @@ -4,7 +4,7 @@ direnv reload ./engine/build.sh echo "Watching $PWD/{src,templates}" # fswatch --exclude='\\.#' src | while read event; do -fswatch --exclude='^.*\.#.*$' src templates | while read event; do +fswatch --exclude='^.*\.#.*$' src engine templates | while read event; do echo "$event" ./engine/build.sh done diff --git a/engine/mk-index.sh b/engine/mk-index.sh index 045bae8..6d47b22 100755 --- a/engine/mk-index.sh +++ b/engine/mk-index.sh @@ -27,8 +27,8 @@ findtitle(){ < $1 hxselect -c $titleaccessor } findkeywords(){ < $1 hxselect -c $keywordsaccessor | sed 's/,/ /g' } mktaglist(){ for keyword in $*; do - printf "\\n%s" $keyword - done + printf "%s" $keyword + done | sed 's#><#>, <#g' } autoload -U colors && colors @@ -47,9 +47,8 @@ for xfic in $indexdir/**/*.xml; do printf ": %-55s" "$title ($keywords)" taglist=$(mktaglist $keywords) { printf "\\n
  • " - printf "\\n%s%s" "$d" + printf "\\n%s" "$d" printf "\\n%s" "${blogfile}" "$title" - printf "%s" "$taglist" printf "\\n
  • \\n\\n" } >> "$tmpdir/${d}-$(basename $xfic).index" dates=( $d $dates ) @@ -60,8 +59,6 @@ echo "Publishing" # building the body -cat templates/index-preamble.html >> $tmpdir/index - previousyear="" for fic in $(ls $tmpdir/*.index | sort -r | head -n $maxarticles ); do echo "${fic:t}" @@ -76,10 +73,10 @@ for fic in $(ls $tmpdir/*.index | sort -r | head -n $maxarticles ); do fi cat $fic >> $tmpdir/index done -cat templates/index-postamble.html >> $tmpdir/index +echo "" >> $tmpdir/index -title="Yann Esposito's Posts" -description="The index of my most recent articles." +title="Y" +description="Most recent articles" author="Yann Esposito" body=$(< $tmpdir/index) date=$(LC_TIME=en_US date +'%Y-%m-%d') @@ -87,7 +84,7 @@ date=$(LC_TIME=en_US date +'%Y-%m-%d') # A neat trick to use pandoc template within a shell script # the pandoc templates use $x$ format, we replace it by just $x # to be used with envsubst -template=$(< templates/post.html | \ +template=$(< templates/index.html | \ sed 's/\$\(header-includes\|table-of-content\)\$//' | \ sed 's/\$if.*\$//' | \ perl -pe 's#(\$[^\$]*)\$#$1#g' ) diff --git a/src/css/y.css b/src/css/y.css index f9e167f..b502ff7 100644 --- a/src/css/y.css +++ b/src/css/y.css @@ -66,9 +66,7 @@ figcaption { text-align: right; font-style: italic; font-size: 0.875em; } #toc { font-size: 0.875em; padding: 1rem; } #toc ul { padding-left: 2em; } #toc, blockquote { margin: 0 1rem; padding-left: 1rem; } -.pubDate { font-size: .825em; opacity: 0.4; margin-right: 1em; } -.tags { margin-left: 1em; opacity: 0.4; } -.tag { font-size: .7em; padding: 0 3px; font-style: italic; } +.pubDate { display: inline-block; width: 7em; font-size: .825em; opacity: 0.4; } /* COLORS */ /* colortheme switch */ @@ -126,3 +124,7 @@ a,a:visited { color: var(--fg); } .co { opacity: 0.4; } .todo,.done { background: var(--r); color: #FFF; font-weight: bold; font-size: .66em; padding: .2em;} .done { background: var(--g); } + +/* LEGACY */ +.inlineblockimg { display: inline-block; } +.inlineblockimg > img { display: inline-block; vertical-align: middle; width: 3em; } diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..e16066b --- /dev/null +++ b/templates/index.html @@ -0,0 +1,51 @@ + + + + + + $title$ + + + + + + + $header-includes$ + + +
    + +
    +$if(toc)$
    $table-of-contents$
    $endif$ +$body$ + +

    Archives from my previous dead blog

    + + + +
    +
    +
    + +
    +
    +
    + + diff --git a/templates/post.html b/templates/post.html index f6fd9a7..1553d63 100644 --- a/templates/post.html +++ b/templates/post.html @@ -16,7 +16,7 @@