paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 189aa891ce9a00b2ccd4cdcecb1c22eef2063fa4
parent 7b1bcc660f01ff9442f8f95934da5c6ae092ce66
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Tue,  7 May 2019 18:39:19 -0400

Add functionality to createpages.sh to parse and add meta tag information

Diffstat:
Mcreatepages.sh | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/createpages.sh b/createpages.sh @@ -75,6 +75,14 @@ for page in $@; do sed -i "s/<title>.*<\/title>/<title>paritybit.ca – ${pagetitle//&/\\&}<\/title>/" \ $htmldir/$savepath/$pagename.html + # Assumes the third line of every markdown file is the <meta> tag + # information (preceded by [//]: # + metatext=$(sed '3!d' $filepath/$pagename.md | cut -d# -f 2) + # Remove leading whitespace + metatextclean=$(echo -e "${metatext}" | sed -e 's/^[[:space:]]*//') + sed -i "s/content=\"\"/content=${metatextclean//&/\\&}/" \ + $htmldir/$savepath/$pagename.html + echo -e "=====Created $htmldir/$savepath/$pagename.html=====\n" fi done