summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-07-03 19:46:33 +0300
committereug-vs <eug-vs@keemail.me>2021-07-03 19:46:45 +0300
commit317c9b42081aa033abd7b46f05f47428f2942ae7 (patch)
treec3fb6c8d0898c8b897341ae7e14f3ea34273cbca /Makefile
parent22e5cfc2ed1e8a654257507e2f3078007ed4b318 (diff)
downloadeug-vs-xyz-317c9b42081aa033abd7b46f05f47428f2942ae7.tar.gz
feat: gather scripts into Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 28 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7a64cdc
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,28 @@
+RSYNC_DESTINATION=root@eug-vs.xyz:/var/www/website
+
+MARKDOWN=gfm+emoji
+STYLESHEET=/style.css
+HEADER=header.html
+ICON=icon.html
+PAGETITLE="Eugene's Space"
+PANDOC_ARGS=-s --from=$(MARKDOWN) --to=html -c $(STYLESHEET) -B $(HEADER) -H $(ICON) -M pagetitle=$(PAGETITLE) --shift-heading-level-by=1
+
+LINK_SEDSTRING=s/.md)/.html)/g;
+EMOJI_SEDSTRING=$(shell ./compile_emoji_sedstring.sh)
+
+SOURCES=$(wildcard *.md blog/*.md)
+HTML=$(patsubst %.md, %.html, $(SOURCES))
+
+
+all: $(HTML)
+
+%.html: %.md
+ @echo $@
+ @cat $< | sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" | pandoc $(PANDOC_ARGS) > $@
+
+deploy: $(HTML)
+ rsync -zarv --exclude=".git" --exclude="*.md" . $(RSYNC_DESTINATION)
+
+clean:
+ rm -f $(HTML)
+