Welcome to mirror list, hosted at ThFree Co, Russian Federation.

lunr.sh « bin - github.com/syui/hugo-theme-wave.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 612161c13b1ad80d9476f9739fc2a28b58479c00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/zsh
d=${0:a:h:h}
# backup
h=${0:a:h}
if cat $j|jq . ;then
	cp $j $h
fi
h=$h/PagesIndex.json
j=$d/static/bower_components/lunr.js/PagesIndex.json
t=`cat $j |jq '.[]'|sed -e 's#/post##g'`
a=`cat $j | sed -e 's#/post##g'`
echo $a >! $j
t=`echo $t|jq -r '.href'|cut -d - -f 1-4`

for (( i=1;i<=`echo "$t"|wc -l`;i++ ))
do
	f=`echo "$t"|awk "NR==$i"`
	c=`echo $f|tr '-' '/'`
	sed -i "" "s#${f}#${c}#g" $j
done

cat $j

diff $j $h