Browse Source

Link my old archives

exp-with-scrum
parent
commit
bf2387bb68
Signed by: yogsototh GPG Key ID: 7B19A4C650D59646
  1. 4
      Makefile
  2. 2
      engine/auto-build.sh
  3. 17
      engine/mk-index.sh
  4. 8
      src/css/y.css
  5. 51
      templates/index.html
  6. 2
      templates/post.html

4
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

2
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

17
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<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' )

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

51
templates/index.html

File diff suppressed because one or more lines are too long

2
templates/post.html

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

Loading…
Cancel
Save