summaryrefslogtreecommitdiff
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
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.)
-rwxr-xr-xbuild.sh4
-rwxr-xr-xstrus/create_xml.sh20
-rw-r--r--strus/document.ana4
-rwxr-xr-xtest.sh2
-rw-r--r--themes/new_theme/layouts/partials/ranklist.html5
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
<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;
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'
} )