diff options
-rw-r--r-- | Makefile | 12 | ||||
-rwxr-xr-x | compile_emoji_sedstring.sh | 2 | ||||
-rwxr-xr-x | header.html | 2 | ||||
-rwxr-xr-x | index.md | 2 |
4 files changed, 14 insertions, 4 deletions
@@ -10,6 +10,9 @@ PANDOC_ARGS=-s --from=$(MARKDOWN) --to=html -c $(STYLESHEET) -B $(HEADER) -H $(I LINK_SEDSTRING=s/.md)/.html)/g; EMOJI_SEDSTRING=$(shell ./compile_emoji_sedstring.sh) +LOCALIZE_SEDSTRING=s|\"/|\"$(PWD)/|; +UNLOCALIZE_SEDSTRING=s|$(PWD)||; + SOURCES=$(wildcard *.md blog/*.md) HTML=$(patsubst %.md, %.html, $(SOURCES)) @@ -27,14 +30,21 @@ index.html: index.md blog/preview.md blog/preview.md: blog/index.md @echo $@ - @sed -n "s/^-/ -/; /^ -/p" $< | head -n 4 > $@ + @sed -n "s/^-/ -/; s|(|(blog/| ; /^ -/p" $< | head -n 4 > $@ open: $(HTML) $(BROWSER) index.html deploy: $(HTML) + $(MAKE) unlocalize rsync -zarv --exclude=".git" --exclude="*.md" . $(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 + clean: rm -f $(HTML) blog/preview.md diff --git a/compile_emoji_sedstring.sh b/compile_emoji_sedstring.sh index 2fb2f6d..3337e59 100755 --- a/compile_emoji_sedstring.sh +++ b/compile_emoji_sedstring.sh @@ -6,5 +6,5 @@ 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; " + echo "s|:${BASENAME}:|<img src=\\\"/public/emoji/${EMOJI}\\\" alt=\\\"${BASENAME}-icon\\\" height=\\\"${SIZE}\\\" width=\\\"${SIZE}\\\" style=\\\"${STYLE}\\\">|g; " done diff --git a/header.html b/header.html index 5ad7977..55b5c27 100755 --- a/header.html +++ b/header.html @@ -1,5 +1,5 @@ <header class="display: inline"> - <a href="https://eug-vs.xyz"> + <a href="/"> <img src="/public/eug-vs.png" alt="eug-vs" width="128px"> <h1 style="margin-top: 12px;">Eugene's Space</h1> </a> @@ -9,7 +9,7 @@ This website runs on my local *Raspberry Pi* and features secure **HTTPS** conne No bullshit, ads, trackers or client-side JavaScript here. -# Recent blog posts +# Recent blog posts :newspaper: - [See all...](./blog/index.md) # Articles :page_with_curl: |