Link my old archives

This commit is contained in:
Yann Esposito (Yogsototh) 2021-05-25 10:25:11 +02:00
parent dba9ae1393
commit bf2387bb68
Signed by untrusted user who does not match committer: yogsototh
GPG Key ID: 7B19A4C650D59646
6 changed files with 68 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -27,8 +27,8 @@ findtitle(){ < $1 hxselect -c $titleaccessor }
findkeywords(){ < $1 hxselect -c $keywordsaccessor | sed 's/,/ /g' }
mktaglist(){
for keyword in $*; do
printf "\\n<span class=\"tag\">%s</span>" $keyword
done
printf "<span class=\"tag\">%s</span>" $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<li>"
printf "\\n<span class=\"pubDate\">%s</span>%s" "$d"
printf "\\n<span class=\"pubDate\">%s</span>" "$d"
printf "\\n<a href=\"%s\">%s</a>" "${blogfile}" "$title"
printf "<span class=\"tags\">%s</span>" "$taglist"
printf "\\n</li>\\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 "</ul>" >> $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' )

View File

@ -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; }

51
templates/index.html Normal file

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
<div class="main">
<div id="logo">
<a href="/">
<svg width="5em" viewBox="0 0 64 64">
<svg viewBox="0 0 64 64">
<circle cx="32" cy="32" r="30" stroke="#a3aec2" stroke-width="2" fill="#2E3440"/>
<circle cx="32" cy="32" r="12" stroke="#e62729" stroke-width="2" fill="#d84100"/>
<circle cx="32" cy="32" r="6" stroke-width="0" fill="#c18600"/>