diff options
-rw-r--r-- | Makefile | 28 | ||||
-rwxr-xr-x | compile_emoji_sedstring.sh | 2 | ||||
-rwxr-xr-x | convert.sh | 12 | ||||
-rwxr-xr-x | deploy.sh | 5 |
4 files changed, 29 insertions, 18 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) + diff --git a/compile_emoji_sedstring.sh b/compile_emoji_sedstring.sh index 86e1291..2a71715 100755 --- a/compile_emoji_sedstring.sh +++ b/compile_emoji_sedstring.sh @@ -3,5 +3,5 @@ cd public/emoji; for EMOJI in *; do BASENAME=${EMOJI%.*} - echo "s|:${BASENAME}:|<img src=\"/public/emoji/${EMOJI}\" height=\"24px\" style=\"margin-bottom: -4px\">|g; " + echo "s|:${BASENAME}:|<img src=\\\"/public/emoji/${EMOJI}\\\" height=\\\"24px\\\" style=\\\"margin-bottom: -4px\\\">|g; " done diff --git a/convert.sh b/convert.sh deleted file mode 100755 index edb8724..0000000 --- a/convert.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -echo Writing to ${1%.*}.html - -if [ -z "${2}" ]; then - SEDSTRING=$(./compile_emoji_sedstring.sh) -else - SEDSTRING=$2 -fi - -cat "$1" \ - | sed "s/.md)/.html)/g; $SEDSTRING" \ - | pandoc -s --from=gfm+emoji --to=html -c /style.css -B header.html -H icon.html -M pagetitle="Eugene's Space" --shift-heading-level-by=1 > ${1%.*}.html diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index de6af59..0000000 --- a/deploy.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -EMOJI_SEDSTRING=$(./compile_emoji_sedstring.sh) -find . -type f -name '*.md' -exec ./convert.sh {} "$EMOJI_SEDSTRING" \; -rsync -zarv --exclude=".git" --exclude="*.md" . root@eug-vs.xyz:/var/www/website - |