summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 9 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 4f61ae7..27ca3f4 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,10 @@ BROWSER=brave
MARKDOWN=gfm+emoji
STYLESHEET=/style.css
+HEAD=head.html
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 --highlight-style=gruvbox.theme
+TITLE=Eugene's Space
+PANDOC_ARGS=-s --from=$(MARKDOWN) --to=html -c $(STYLESHEET) -B $(HEADER) -H $(HEAD) --shift-heading-level-by=1 --highlight-style=gruvbox.theme
LINK_SEDSTRING=s/.md)/.html)/g;
EMOJI_SEDSTRING=$(shell ./compile_emoji_sedstring.sh)
@@ -22,11 +22,15 @@ all: $(HTML)
%.html: %.md
@echo $@
- @sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" $< | pandoc $(PANDOC_ARGS) > $@
+ @PAGETITLE=$$(sed '/^#/q' $< | sed 's/:[a-z]*://; s/#* //'); \
+ sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" $< \
+ | pandoc $(PANDOC_ARGS) -M pagetitle="$$PAGETITLE | $(TITLE)" > $@
index.html: index.md blog/preview.md
@echo $@
- @sed "/Recent blog posts/r blog/preview.md" $< | sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" | pandoc $(PANDOC_ARGS) > $@
+ @sed "/Recent blog posts/r blog/preview.md" $< \
+ | sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" \
+ | pandoc $(PANDOC_ARGS) -M pagetitle="$(TITLE)" > $@
blog/preview.md: blog/index.md
@echo $@