diff options
-rwxr-xr-x | compile_emoji_sedstring.sh | 7 | ||||
-rwxr-xr-x | convert.sh | 11 | ||||
-rwxr-xr-x | deploy.sh | 3 |
3 files changed, 18 insertions, 3 deletions
diff --git a/compile_emoji_sedstring.sh b/compile_emoji_sedstring.sh new file mode 100755 index 0000000..86e1291 --- /dev/null +++ b/compile_emoji_sedstring.sh @@ -0,0 +1,7 @@ +#!/bin/sh +cd public/emoji; +for EMOJI in *; +do + BASENAME=${EMOJI%.*} + echo "s|:${BASENAME}:|<img src=\"/public/emoji/${EMOJI}\" height=\"24px\" style=\"margin-bottom: -4px\">|g; " +done @@ -1,5 +1,12 @@ #!/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' \ - | pandoc -s --from=gfm --to=html -c /style.css -B header.html -H icon.html -M pagetitle="Eugene's Space" --shift-heading-level-by=1 > ${1%.*}.html + | 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 @@ -1,4 +1,5 @@ #!/bin/sh -find . -type f -name '*.md' -exec ./convert.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 |