summaryrefslogtreecommitdiff
path: root/strus/create_xml.sh
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-03-05 19:06:03 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2017-03-05 19:06:03 +0100
commit23d27034dd3eee14e3fe953a3aea0e27c9739569 (patch)
tree526e63894a5136e50ed5c30dbd3404b15697604c /strus/create_xml.sh
parentec22ee8f502797676b9704b8313f77e7dc86be1e (diff)
downloadwww-andreasbaumann-cc-23d27034dd3eee14e3fe953a3aea0e27c9739569.tar.gz
www-andreasbaumann-cc-23d27034dd3eee14e3fe953a3aea0e27c9739569.tar.bz2
fixed to run on OSX with software installed from brew (hugo, etc.)
Diffstat (limited to 'strus/create_xml.sh')
-rwxr-xr-xstrus/create_xml.sh20
1 files changed, 13 insertions, 7 deletions
diff --git a/strus/create_xml.sh b/strus/create_xml.sh
index fa7ddd6..422e16f 100755
--- a/strus/create_xml.sh
+++ b/strus/create_xml.sh
@@ -5,9 +5,15 @@ cat <<EOF
<posts>
EOF
+if test `uname -s` = 'Darwin'; then
+ SED=gsed
+else
+ SED=sed
+fi
+
for file in `find ../content/ -name '*.md'`; do
echo "$file.." 1>&2
- slug=`echo $file | sed 's@../content@@g' | sed 's@/_index.md$@@g' | sed 's@.md$@@g'`
+ slug=`echo $file | $SED 's@../content@@g' | $SED 's@/_index.md$@@g' | $SED 's@.md$@@g'`
if test "x$slug" = "x"; then
slug="/"
fi
@@ -21,12 +27,12 @@ for file in `find ../content/ -name '*.md'`; do
tail -n +2 F1 > meta.toml
tail -n +3 F2 > body.md
- sed -i 's/\&/&amp;/g' meta.toml
- sed -i 's/</\&lt;/g' meta.toml
- sed -i 's/>/\&gt;/g' meta.toml
- sed -i 's/\&/&amp;/g' body.md
- sed -i 's/</\&lt;/g' body.md
- sed -i 's/>/\&gt;/g' body.md
+ $SED -i 's/\&/&amp;/g' meta.toml
+ $SED -i 's/</\&lt;/g' meta.toml
+ $SED -i 's/>/\&gt;/g' meta.toml
+ $SED -i 's/\&/&amp;/g' body.md
+ $SED -i 's/</\&lt;/g' body.md
+ $SED -i 's/>/\&gt;/g' body.md
remarshal -if toml -of json meta.toml > meta.json
pandoc -f markdown -t docbook body.md > body.xml