disable openring, clean up makefile
This commit is contained in:
parent
e493f9088c
commit
f035ed0c9d
2 changed files with 91 additions and 53 deletions
33
GNUmakefile
33
GNUmakefile
|
|
@ -3,12 +3,12 @@ DEPLOY_BLOBS = andrea0s-plain-noextfonts.svg \
|
||||||
blob/ebrimabd.ttf \
|
blob/ebrimabd.ttf \
|
||||||
blob/window-capture \
|
blob/window-capture \
|
||||||
blob/vcf-2024-pile.jpg
|
blob/vcf-2024-pile.jpg
|
||||||
AWESOME_BLOGS := -s https://lwn.net/headlines/rss \
|
# AWESOME_BLOGS := -s https://lwn.net/headlines/rss \
|
||||||
-s https://lobste.rs/rss \
|
# -s https://lobste.rs/rss \
|
||||||
-s https://blog.haskell.org/atom.xml \
|
# -s https://blog.haskell.org/atom.xml \
|
||||||
-s https://www.phoronix.com/rss.php \
|
# -s https://www.phoronix.com/rss.php \
|
||||||
-s https://static.fsf.org/fsforg/rss/news.xml \
|
# -s https://static.fsf.org/fsforg/rss/news.xml \
|
||||||
-s https://emersion.fr/blog/rss.xml
|
# -s https://emersion.fr/blog/rss.xml
|
||||||
|
|
||||||
UNAME = $(shell uname)
|
UNAME = $(shell uname)
|
||||||
ifeq ($(UNAME),Linux)
|
ifeq ($(UNAME),Linux)
|
||||||
|
|
@ -29,13 +29,11 @@ blog/%.indicator.html: indicators
|
||||||
blog/%.html: %.head.html nav.head.html %.indicator.html nav.tail.html window.head.html %.inner.html window.tail.html
|
blog/%.html: %.head.html nav.head.html %.indicator.html nav.tail.html window.head.html %.inner.html window.tail.html
|
||||||
cat $^ > $@
|
cat $^ > $@
|
||||||
|
|
||||||
vcf%.html: vcf%.head.html nav.head.html blog/vcf%.indicator.html nav.tail.html window.head.html blog/vcf%.inner.html window.tail.html
|
blog/feed.xml blog.inner.html: $(BLOG_SRC) scripts/blogposts.bash #modules/openring/openring
|
||||||
cat $^ > $@
|
scripts/blogposts.bash > $@
|
||||||
|
# scripts/blogposts.bash \
|
||||||
blog.inner.html: $(BLOG_SRC)
|
# | modules/openring/openring -n 12 -p 3 \
|
||||||
scripts/blogposts.bash \
|
# $(AWESOME_BLOGS) > $@
|
||||||
| modules/openring/openring -n 12 -p 3 \
|
|
||||||
$(AWESOME_BLOGS) > $@
|
|
||||||
|
|
||||||
modules/openring/openring.go: .gitmodules
|
modules/openring/openring.go: .gitmodules
|
||||||
git submodule update --init --recursive -- modules/openring
|
git submodule update --init --recursive -- modules/openring
|
||||||
|
|
@ -66,8 +64,11 @@ index.html: indexhead.html nav.head.html index.indicator.html nav.tail.html inde
|
||||||
%.html: %.head.html nav.head.html %.indicator.html nav.tail.html window.head.html %.inner.html window.tail.html
|
%.html: %.head.html nav.head.html %.indicator.html nav.tail.html window.head.html %.inner.html window.tail.html
|
||||||
cat $^ > $@
|
cat $^ > $@
|
||||||
|
|
||||||
test: index.html
|
test: deploy
|
||||||
$(OPEN) $<
|
$(OPEN) $@.html
|
||||||
|
cd $(DEPLOY_HTTPROOT) \
|
||||||
|
&& ln -s . '~targetdisk' \
|
||||||
|
&& python -m http.server
|
||||||
|
|
||||||
$(DEPLOY_HTTPROOT)/blob:
|
$(DEPLOY_HTTPROOT)/blob:
|
||||||
mkdir -p $(@)
|
mkdir -p $(@)
|
||||||
|
|
@ -77,6 +78,6 @@ deploy: all $(DEPLOY_HTTPROOT)/blob
|
||||||
cp -rv *.css *.html blog media \
|
cp -rv *.css *.html blog media \
|
||||||
$(DEPLOY_HTTPROOT)
|
$(DEPLOY_HTTPROOT)
|
||||||
|
|
||||||
all: blog-posts index.html blog.html resume.html vcfmw-2024.html
|
all: blog-posts index.html blog.html resume.html
|
||||||
|
|
||||||
.PHONY: all blog-posts indicators deploy
|
.PHONY: all blog-posts indicators deploy
|
||||||
|
|
|
||||||
|
|
@ -1,55 +1,92 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
HEADING='Posts'
|
||||||
|
TITLE="Andrea's blog"
|
||||||
|
BASENAME=${BASENAME-blog}
|
||||||
|
BASE_URL=${BASE_URL-https://sqt.wtf}
|
||||||
|
DESCRIPTION="Andrea's personal blog."
|
||||||
|
N_DESC_CHARS=500
|
||||||
|
|
||||||
|
articles=( $BASENAME/*.md )
|
||||||
|
|
||||||
cat <<HDR
|
cat <<HDR
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h1>Posts</h1>
|
<h1>$HEADING</h1>
|
||||||
<dl> <!-- no longer me -->
|
<dl> <!-- no longer me -->
|
||||||
HDR
|
HDR
|
||||||
|
|
||||||
for blog_post_md in blog/*.md; do
|
cat > blog/feed.xml <<RSSHDR
|
||||||
date=$(grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' <<<"$blog_post_md")
|
<rss version="2.0">
|
||||||
title=$(grep -m 1 '^#\s\+' "$blog_post_md" | sed 's/^#\s\+//')
|
<channel>
|
||||||
html=$(sed 's/\.md$/.html/' <<<"$blog_post_md")
|
<title>$TITLE</title>
|
||||||
|
<link>$BASE_URL/$BASENAME.html</link>
|
||||||
|
<description>$DESCRIPTION</description>
|
||||||
|
RSSHDR
|
||||||
|
|
||||||
|
for ((i=${#articles[@]}-1; i>=0; i--)); do
|
||||||
|
post_md=${articles[$i]}
|
||||||
|
date=$(grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' <<<"$post_md")
|
||||||
|
title=$(grep -m 1 '^#\s\+' "$post_md" | sed 's/^#\s\+//')
|
||||||
|
html=$(sed 's/\.md$/.html/' <<<"$post_md")
|
||||||
|
rss_desc=$(grep -v '^\s*$' "$post_md" | grep -v '^\s*\*by' | grep -v '^#' | grep -v '^\s*!\[' | grep -v '<.\+>'| head -c $N_DESC_CHARS)'...'
|
||||||
|
|
||||||
cat <<INNIE
|
cat <<INNIE
|
||||||
<dt>$date</dt>
|
<dt>$date</dt>
|
||||||
<dd><a href="$html">$title</a></dd>
|
<dd><a href="$html">$title</a></dd>
|
||||||
INNIE
|
INNIE
|
||||||
|
|
||||||
|
cat >> $BASENAME/feed.xml <<RSSINNIE
|
||||||
|
<item>
|
||||||
|
<title>$title</title>
|
||||||
|
<link>$BASE_URL/~targetdisk/$html</link>
|
||||||
|
<description>$rss_desc</description>
|
||||||
|
<pubDate>$(date -d "$date" '+%a, %d %b %Y %H:%M:%S %Z')</pubDate>
|
||||||
|
</item>
|
||||||
|
RSSINNIE
|
||||||
done
|
done
|
||||||
|
|
||||||
cat <<FTR # Short for Fetterman
|
cat <<FTR # Short for Fetterman
|
||||||
</dl> <!-- no longer on the dl -->
|
</dl> <!-- no longer on the dl -->
|
||||||
|
<p><a href="/~targetdisk/$BASENAME/feed.xml">RSS</a></p>
|
||||||
<h2>Other People's Posts</h2>
|
|
||||||
{{range .Articles}}
|
|
||||||
<div>
|
|
||||||
<h4 class="title" dir="auto">
|
|
||||||
<a href="{{.Link}}" target="_blank" rel="noopener">{{.Title}}</a>
|
|
||||||
</h4>
|
|
||||||
<p class="summary" dir="auto">{{.Summary}}</p>
|
|
||||||
<small class="source">
|
|
||||||
via <a href="{{.SourceLink}}">{{.SourceTitle}}</a>
|
|
||||||
</small>
|
|
||||||
<small class="date">{{.Date | datef "January 2, 2006"}}</small>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
</br></br>
|
|
||||||
<small>
|
|
||||||
<p>
|
|
||||||
Generated by
|
|
||||||
<a href="https://git.sr.ht/~sircmpwn/openring">openring</a>
|
|
||||||
</p>
|
|
||||||
</small>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
|
||||||
.webring .title {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.webring .summary {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
flex: 1 1 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
FTR
|
FTR
|
||||||
|
|
||||||
|
#
|
||||||
|
# <h2>Other People's Posts</h2>
|
||||||
|
# {{range .Articles}}
|
||||||
|
# <div>
|
||||||
|
# <h4 class="title" dir="auto">
|
||||||
|
# <a href="{{.Link}}" target="_blank" rel="noopener">{{.Title}}</a>
|
||||||
|
# </h4>
|
||||||
|
# <p class="summary" dir="auto">{{.Summary}}</p>
|
||||||
|
# <small class="source">
|
||||||
|
# via <a href="{{.SourceLink}}">{{.SourceTitle}}</a>
|
||||||
|
# </small>
|
||||||
|
# <small class="date">{{.Date | datef "January 2, 2006"}}</small>
|
||||||
|
# </div>
|
||||||
|
# {{end}}
|
||||||
|
#
|
||||||
|
# </br></br>
|
||||||
|
# <small>
|
||||||
|
# <p>
|
||||||
|
# Generated by
|
||||||
|
# <a href="https://git.sr.ht/~sircmpwn/openring">openring</a>
|
||||||
|
# </p>
|
||||||
|
# </small>
|
||||||
|
#</div>
|
||||||
|
#
|
||||||
|
#<style>
|
||||||
|
#.webring .title {
|
||||||
|
# margin: 0;
|
||||||
|
#}
|
||||||
|
#.webring .summary {
|
||||||
|
# font-size: 0.8rem;
|
||||||
|
# flex: 1 1 0;
|
||||||
|
#}
|
||||||
|
#</style>
|
||||||
|
#FTR
|
||||||
|
|
||||||
|
cat >> $BASENAME/feed.xml <<RSSFTR
|
||||||
|
</channel>
|
||||||
|
</rss>
|
||||||
|
RSSFTR
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue