Link my old archives
This commit is contained in:
parent
dba9ae1393
commit
bf2387bb68
6 changed files with 68 additions and 16 deletions
4
Makefile
4
Makefile
|
@ -66,7 +66,8 @@ ALL += indexcache
|
||||||
# HTML INDEX
|
# HTML INDEX
|
||||||
HTML_INDEX := $(DST_DIR)/index.html
|
HTML_INDEX := $(DST_DIR)/index.html
|
||||||
MKINDEX := engine/mk-index.sh
|
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)
|
@mkdir -p $(DST_DIR)
|
||||||
$(MKINDEX)
|
$(MKINDEX)
|
||||||
.PHONY: index
|
.PHONY: index
|
||||||
|
@ -85,6 +86,7 @@ MKRSS := engine/mkrss.sh
|
||||||
$(RSS): $(DST_RSS_FILES) $(MKRSS)
|
$(RSS): $(DST_RSS_FILES) $(MKRSS)
|
||||||
$(MKRSS)
|
$(MKRSS)
|
||||||
ALL += $(RSS)
|
ALL += $(RSS)
|
||||||
|
|
||||||
.PHONY: rss
|
.PHONY: rss
|
||||||
rss: $(DST_RSS_FILES) $(RSS)
|
rss: $(DST_RSS_FILES) $(RSS)
|
||||||
ALL += rss
|
ALL += rss
|
||||||
|
|
|
@ -4,7 +4,7 @@ direnv reload
|
||||||
./engine/build.sh
|
./engine/build.sh
|
||||||
echo "Watching $PWD/{src,templates}"
|
echo "Watching $PWD/{src,templates}"
|
||||||
# fswatch --exclude='\\.#' src | while read event; do
|
# 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"
|
echo "$event"
|
||||||
./engine/build.sh
|
./engine/build.sh
|
||||||
done
|
done
|
||||||
|
|
|
@ -27,8 +27,8 @@ findtitle(){ < $1 hxselect -c $titleaccessor }
|
||||||
findkeywords(){ < $1 hxselect -c $keywordsaccessor | sed 's/,/ /g' }
|
findkeywords(){ < $1 hxselect -c $keywordsaccessor | sed 's/,/ /g' }
|
||||||
mktaglist(){
|
mktaglist(){
|
||||||
for keyword in $*; do
|
for keyword in $*; do
|
||||||
printf "\\n<span class=\"tag\">%s</span>" $keyword
|
printf "<span class=\"tag\">%s</span>" $keyword
|
||||||
done
|
done | sed 's#><#>, <#g'
|
||||||
}
|
}
|
||||||
|
|
||||||
autoload -U colors && colors
|
autoload -U colors && colors
|
||||||
|
@ -47,9 +47,8 @@ for xfic in $indexdir/**/*.xml; do
|
||||||
printf ": %-55s" "$title ($keywords)"
|
printf ": %-55s" "$title ($keywords)"
|
||||||
taglist=$(mktaglist $keywords)
|
taglist=$(mktaglist $keywords)
|
||||||
{ printf "\\n<li>"
|
{ 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 "\\n<a href=\"%s\">%s</a>" "${blogfile}" "$title"
|
||||||
printf "<span class=\"tags\">%s</span>" "$taglist"
|
|
||||||
printf "\\n</li>\\n\\n"
|
printf "\\n</li>\\n\\n"
|
||||||
} >> "$tmpdir/${d}-$(basename $xfic).index"
|
} >> "$tmpdir/${d}-$(basename $xfic).index"
|
||||||
dates=( $d $dates )
|
dates=( $d $dates )
|
||||||
|
@ -60,8 +59,6 @@ echo "Publishing"
|
||||||
|
|
||||||
# building the body
|
# building the body
|
||||||
|
|
||||||
cat templates/index-preamble.html >> $tmpdir/index
|
|
||||||
|
|
||||||
previousyear=""
|
previousyear=""
|
||||||
for fic in $(ls $tmpdir/*.index | sort -r | head -n $maxarticles ); do
|
for fic in $(ls $tmpdir/*.index | sort -r | head -n $maxarticles ); do
|
||||||
echo "${fic:t}"
|
echo "${fic:t}"
|
||||||
|
@ -76,10 +73,10 @@ for fic in $(ls $tmpdir/*.index | sort -r | head -n $maxarticles ); do
|
||||||
fi
|
fi
|
||||||
cat $fic >> $tmpdir/index
|
cat $fic >> $tmpdir/index
|
||||||
done
|
done
|
||||||
cat templates/index-postamble.html >> $tmpdir/index
|
echo "</ul>" >> $tmpdir/index
|
||||||
|
|
||||||
title="Yann Esposito's Posts"
|
title="Y"
|
||||||
description="The index of my most recent articles."
|
description="Most recent articles"
|
||||||
author="Yann Esposito"
|
author="Yann Esposito"
|
||||||
body=$(< $tmpdir/index)
|
body=$(< $tmpdir/index)
|
||||||
date=$(LC_TIME=en_US date +'%Y-%m-%d')
|
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
|
# A neat trick to use pandoc template within a shell script
|
||||||
# the pandoc templates use $x$ format, we replace it by just $x
|
# the pandoc templates use $x$ format, we replace it by just $x
|
||||||
# to be used with envsubst
|
# to be used with envsubst
|
||||||
template=$(< templates/post.html | \
|
template=$(< templates/index.html | \
|
||||||
sed 's/\$\(header-includes\|table-of-content\)\$//' | \
|
sed 's/\$\(header-includes\|table-of-content\)\$//' | \
|
||||||
sed 's/\$if.*\$//' | \
|
sed 's/\$if.*\$//' | \
|
||||||
perl -pe 's#(\$[^\$]*)\$#$1#g' )
|
perl -pe 's#(\$[^\$]*)\$#$1#g' )
|
||||||
|
|
|
@ -66,9 +66,7 @@ figcaption { text-align: right; font-style: italic; font-size: 0.875em; }
|
||||||
#toc { font-size: 0.875em; padding: 1rem; }
|
#toc { font-size: 0.875em; padding: 1rem; }
|
||||||
#toc ul { padding-left: 2em; }
|
#toc ul { padding-left: 2em; }
|
||||||
#toc, blockquote { margin: 0 1rem; padding-left: 1rem; }
|
#toc, blockquote { margin: 0 1rem; padding-left: 1rem; }
|
||||||
.pubDate { font-size: .825em; opacity: 0.4; margin-right: 1em; }
|
.pubDate { display: inline-block; width: 7em; font-size: .825em; opacity: 0.4; }
|
||||||
.tags { margin-left: 1em; opacity: 0.4; }
|
|
||||||
.tag { font-size: .7em; padding: 0 3px; font-style: italic; }
|
|
||||||
|
|
||||||
/* COLORS */
|
/* COLORS */
|
||||||
/* colortheme switch */
|
/* colortheme switch */
|
||||||
|
@ -126,3 +124,7 @@ a,a:visited { color: var(--fg); }
|
||||||
.co { opacity: 0.4; }
|
.co { opacity: 0.4; }
|
||||||
.todo,.done { background: var(--r); color: #FFF; font-weight: bold; font-size: .66em; padding: .2em;}
|
.todo,.done { background: var(--r); color: #FFF; font-weight: bold; font-size: .66em; padding: .2em;}
|
||||||
.done { background: var(--g); }
|
.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
51
templates/index.html
Normal file
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div id="logo">
|
<div id="logo">
|
||||||
<a href="/">
|
<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="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="12" stroke="#e62729" stroke-width="2" fill="#d84100"/>
|
||||||
<circle cx="32" cy="32" r="6" stroke-width="0" fill="#c18600"/>
|
<circle cx="32" cy="32" r="6" stroke-width="0" fill="#c18600"/>
|
||||||
|
|
Loading…
Reference in a new issue