From 23d27034dd3eee14e3fe953a3aea0e27c9739569 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 5 Mar 2017 19:06:03 +0100 Subject: fixed to run on OSX with software installed from brew (hugo, etc.) --- build.sh | 4 ++-- strus/create_xml.sh | 20 +++++++++++++------- strus/document.ana | 4 ++-- test.sh | 2 +- themes/new_theme/layouts/partials/ranklist.html | 5 ++--- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/build.sh b/build.sh index 54524b3..5973954 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/sh rm -rf public -~/go/bin/hugo -v -b http://www.andreasbaumann.cc -sed -i 's@http://eeepc.lan:8080/strus/query/wwwandreasbaumanncc@http://www.andreasbaumann.cc/strus/query/wwwandreasbaumanncc@g' \ +hugo -v -b http://www.andreasbaumann.cc +sed -i 's@http://euromac.lan:8080/strus/query/wwwandreasbaumanncc@http://www.andreasbaumann.cc/strus/query/wwwandreasbaumanncc@g' \ public/search/index.html 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 +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/\&/&/g' meta.toml - sed -i 's//\>/g' meta.toml - sed -i 's/\&/&/g' body.md - sed -i 's//\>/g' body.md + $SED -i 's/\&/&/g' meta.toml + $SED -i 's//\>/g' meta.toml + $SED -i 's/\&/&/g' body.md + $SED -i 's//\>/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; diff --git a/test.sh b/test.sh index 963ce06..5d64e07 100755 --- a/test.sh +++ b/test.sh @@ -1,4 +1,4 @@ #!/bin/sh -~/go/bin/hugo serve --buildDrafts --bind=0.0.0.0 -v --baseURL=http://`hostname -f`:1313 +hugo serve --buildDrafts --bind=0.0.0.0 -v --baseURL=http://`hostname -f`:1313 diff --git a/themes/new_theme/layouts/partials/ranklist.html b/themes/new_theme/layouts/partials/ranklist.html index bcd7be8..8dfbb88 100644 --- a/themes/new_theme/layouts/partials/ranklist.html +++ b/themes/new_theme/layouts/partials/ranklist.html @@ -12,7 +12,6 @@ } function normalize_term( s ) { - // lc:convdia(en):stem(en):lc regex("([A-Za-z']+)") var r = stem( s ); return r.toLowerCase( ); } @@ -157,7 +156,7 @@ params: [ { key: "type", - value: "word" + value: "text" }, { key: "match", @@ -190,7 +189,7 @@ $.ajax( { type : 'POST', - url : 'http://eeepc.lan:8080/strus/query/wwwandreasbaumanncc', + url : 'http://euromac.lan:8080/strus/query/wwwandreasbaumanncc', data : json, contentType : 'application/json' } ) -- cgit v1.2.3-54-g00ecf