summaryrefslogtreecommitdiff
path: root/strus
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
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')
-rwxr-xr-xstrus/create_xml.sh20
-rw-r--r--strus/document.ana4
2 files changed, 15 insertions, 9 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
diff --git a/strus/document.ana b/strus/document.ana
index b261aa3..4a5fa16 100644
--- a/strus/document.ana
+++ b/strus/document.ana
@@ -14,8 +14,8 @@
word = lc:convdia(en):stem(en):lc regex("([A-Za-z']+)") /posts/post/meta()/title();
[ForwardIndex]
- word = orig split /posts/post/body//para();
- word = orig split /posts/post/meta()/title();
+ text = orig split /posts/post/body//para();
+ title = orig split /posts/post/meta()/title();
#[MetaData]
# release_date = date2int("d 1877-01-01", "%Y-%m-%d %H:%M:%s *") content /posts/post/meta()/date;