diff options
Diffstat (limited to 'compile-md.sh')
-rwxr-xr-x | compile-md.sh | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/compile-md.sh b/compile-md.sh deleted file mode 100755 index e0277eb..0000000 --- a/compile-md.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -if [ $# -ne 4 ]; then - echo "./compile-md.sh [page|blog] [title] [in.md] [out.html]" - exit 1 -fi - -ptype=$1 -title=$2 -in=$3 -out=$4 - -if [ $ptype == "blog" ]; then - cat templates/blog-header.html > $out -else - if [ $ptype == "page" ]; then - cat templates/page-header.html > $out - else - echo "Missing first parameter: [page|blog]" - exit 1 - fi -fi - -pclass=$(echo "$title" | tr [:upper:] [:lower:]) -sed -i "s/PAGE_TITLE/$title/" $out # replace title -sed -i "s/PAGE_CLASS/$pclass/" $out # replace class - -markdown -f fencedcode -f autolink $in >> $out - -if [ $1 == "blog" ]; then - cat templates/blog-footer.html >> $out -else - cat templates/page-footer.html >> $out -fi - -# update <a> tags that are external vs internal - assumes all internal links us relative routes -sed -E -i "s/(<a)(.+href=\"http.+\".+>)/\1 rel=\"external noopener noreferrer\" target=\"_blank\" \2/g" $out - -./tidy.sh $out |