diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-04-21 14:58:28 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-04-21 14:58:28 +0300 |
commit | 0b7bc99af62aa53148b7fcede648e5dfb6e2ca22 (patch) | |
tree | 7fbf0051f15815323a11a24f9a779e99f9cf4fe3 | |
parent | aa01f0afe1b6218eddc956b1f9ec901f6256c3c4 (diff) | |
download | eug-vs-xyz-0b7bc99af62aa53148b7fcede648e5dfb6e2ca22.tar.gz |
feat: remove old scripts
-rw-r--r-- | Makefile | 88 | ||||
-rwxr-xr-x | compile_emoji_sedstring.sh | 12 | ||||
-rwxr-xr-x | compile_openring_args.sh | 5 | ||||
-rwxr-xr-x | hot-reload.sh | 4 |
4 files changed, 0 insertions, 109 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index 6ed0e45..0000000 --- a/Makefile +++ /dev/null @@ -1,88 +0,0 @@ -TITLE=Eugene's Space -RSYNC_DESTINATION=eug-vs.xyz:/var/www/website - -MARKDOWN=gfm+emoji -STYLESHEET=/style.css -HEAD=head.html -HEADER=header.html -RSS_FEED=blog/index.xml -OPENRING_FOOTER=footer.html -PANDOC_ARGS= --from=$(MARKDOWN) --to=html -PANDOC_HTML_ARGS=-s $(PANDOC_ARGS) -c $(STYLESHEET) -B $(HEADER) -H $(HEAD) -M lang="en" --shift-heading-level-by=1 --highlight-style=gruvbox.theme - -LINK_SEDSTRING=s/.md)/.html)/g; -EMOJI_SEDSTRING=$(shell ./compile_emoji_sedstring.sh) -LOCALIZE_SEDSTRING=s|\"/|\"$(PWD)/|; -UNLOCALIZE_SEDSTRING=s|$(PWD)||; - -OPENRING_ARGS=$(shell ./compile_openring_args.sh) - - -SOURCES=$(wildcard *.md blog/*.md articles/*.md) -HTML=$(patsubst %.md, %.html, $(SOURCES)) -XML=$(patsubst %.md, %.xml, $(filter-out blog/preview.md, $(filter-out blog/index.md, $(wildcard blog/*.md)))) - - -all: $(HTML) $(RSS_FEED) - -%.html: %.md $(OPENRING_FOOTER) - @echo $@ - @DESCRIPTION=$$(sed '2,/^$$/!d' $< | tr '\n' ' '); \ - PAGETITLE=$$(sed '/^#/q' $< | sed 's/:[a-z]*://; s/#* //'); \ - sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" $< \ - | pandoc $(PANDOC_HTML_ARGS) -M pagetitle="$$PAGETITLE | $(TITLE)" -A $(OPENRING_FOOTER) -M description="$$DESCRIPTION" > $@ - -%.xml: %.md - @echo $@ - @echo '<item>' > $@ - @echo " <link>https://eug-vs.xyz/$*.html</link>" >> $@ - @echo " <pubDate>$$(date --rfc-email -d $$(basename $*))</pubDate>" >> $@ - @echo " <title>$$(sed '/^#/q' $< | sed 's/:[a-z]*://; s/#* //')</title>" >> $@ - @echo " <description><![CDATA[" >> $@ - @sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" $< | pandoc $(PANDOC_ARGS) $< >> $@ - @echo " ]]></description>" >> $@ - @echo '</item>' >> $@ - -$(RSS_FEED): $(XML) - @echo $@ - @echo '<rss version="2.0"><channel>' > $@ - @echo "<title>Eugene's Space</title><link>https://eug-vs.xyz</link><description>Eugene's blog</description>" >> $@ - @echo "<lastBuildDate>$$(date --rfc-email)</lastBuildDate>" >> $@ - @cat $$(echo $^ | tr " " "\n" | sort -r | tr "\n" " ") >> $@ - @echo '</channel></rss>' >> $@ - -index.html: index.md blog/preview.md - @echo $@ - @DESCRIPTION=$$(sed '2,/^$$/!d' $< | tr '\n' ' '); \ - sed "/Recent blog posts/r blog/preview.md" $< \ - | sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" \ - | pandoc $(PANDOC_HTML_ARGS) -M pagetitle="$(TITLE)" -M description="$$DESCRIPTION"> $@ - -$(OPENRING_FOOTER): openring-template.html - @echo $@ - @openring $(OPENRING_ARGS) < $< > $@ - -blog/preview.md: blog/index.md - @echo $@ - @sed -n "s/^-/ -/; s|(|(blog/| ; /^ -/p" $< | head -n 4 > $@ - -open: $(HTML) - xdg-open index.html - -deploy: all - $(MAKE) unlocalize - rsync -rtvzP --include="$(RSS_FEED)" --exclude=".git" --exclude="*.md" --exclude="*.xml" . $(RSYNC_DESTINATION) - -localize: $(HTML) - @for file in $^; do sed -i "$(UNLOCALIZE_SEDSTRING) $(LOCALIZE_SEDSTRING)" $$file; done - -unlocalize: $(HTML) - @for file in $^; do sed -i "$(UNLOCALIZE_SEDSTRING)" $$file; done - -update_openring: - rm -rf $(OPENRING_FOOTER) - $(MAKE) $(OPENRING_FOOTER) - -clean: - rm -f $(HTML) $(XML) $(RSS_FEED) blog/preview.md - diff --git a/compile_emoji_sedstring.sh b/compile_emoji_sedstring.sh deleted file mode 100755 index 006e240..0000000 --- a/compile_emoji_sedstring.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Return a large sed command that will substitute all :emoji: listed in /public/emoji with <img> - -SIZE=20px -STYLE="margin-bottom: -4px;" - -cd public/emoji; -for EMOJI in *; -do - BASENAME=${EMOJI%.*} - echo "s|:${BASENAME}:|<img src=\\\"/public/emoji/${EMOJI}\\\" alt=\\\"${BASENAME}-icon\\\" height=\\\"${SIZE}\\\" width=\\\"${SIZE}\\\" style=\\\"${STYLE}\\\">|g; " -done diff --git a/compile_openring_args.sh b/compile_openring_args.sh deleted file mode 100755 index 52d6660..0000000 --- a/compile_openring_args.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# Compile args string for openring from URLS file -URLS=urls - -sed '/^$/d; s/^/-s /;' $URLS diff --git a/hot-reload.sh b/hot-reload.sh deleted file mode 100755 index 7d5def5..0000000 --- a/hot-reload.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Automatically recompile Markdown sources when they change - -find -type f -name '*.md' | entr -s "make localize" |