diff --git a/src/include/footer.html b/include/footer.html similarity index 63% rename from src/include/footer.html rename to include/footer.html index 7ebef11..8c27cec 100644 --- a/src/include/footer.html +++ b/include/footer.html @@ -2,6 +2,6 @@

附加情報

diff --git a/src/include/header.html b/include/header.html similarity index 100% rename from src/include/header.html rename to include/header.html diff --git a/make.sh b/make.sh index 1df372b..1d32a94 100755 --- a/make.sh +++ b/make.sh @@ -5,39 +5,49 @@ # ./make.sh # - for local reading: # ./make.sh -local +arg1=$1 + +# 静的ファイル +static=" +src/*.css +src/*.js +src/favicon.ico +src/robots.txt +src/images +src/styles +" + +make_html() { + name=`basename $1` + out=www/$name + + cat include/header.html $path >> $out + + # ライセンス表示 + if [ $name = publicdomain.html ]; then + show_license >> $out + # 目次以外にはフッターあり + elif [ $name != index.html ]; then + cat include/footer.html >> $out + fi + + # localでない場合: "./index.html" -> "./" + if [ "$arg1" != '-local' ]; then + sed -i -e's/href=".\/index.html"/href=".\/"/g' $out + fi + echo "$path -> $out" +} + +show_license() { + echo '
'
+	sed -e's/"/\"/g' -e"s/'/\'/g" LICENSE.txt
+	echo '
' + echo '

以上

' +} mkdir -p www rm -rf www/* -cp -pv src/*.css www -cp -pv src/favicon.ico www -cp -pv src/robots.txt www -cp -pv src/076mute.user.js www -cp -rpv src/images www -cp -rpv src/styles www - -cd src - -for name in *.html; do - out=../www/$name - cat include/header.html $name >> $out - - # 目次以外にはフッターあり - if [ $name != index.html ]; then - if [ $1 -a $1 = '-local' ]; then - sed -e's/href="\.\/"/href=".\/index.html"/' include/footer.html >> $out - else - cat include/footer.html >> $out - fi - fi - - echo "src/$name -> www/$name" +cp -rpv $static www +for path in src/*.html; do + make_html $path done - -out=../www/publicdomain.html -cat include/header.html include/publicdomain.html > $out -echo '
' >> $out
-sed -e's/"/\"/g' -e"s/'/\'/g" ../LICENSE.txt >> $out
-echo '
' >> $out -echo '

以上

' >> $out -echo www/publicdomain.html -cd .. diff --git a/notice.sh b/notice.sh index 6cc67ae..26790e6 100755 --- a/notice.sh +++ b/notice.sh @@ -1,13 +1,13 @@ #/bin/sh # usage: -# $ ./notice.sh ./src/hello.html +# $ ./notice.sh src/hello.html BASE_I2P='http://bibi.i2p/' BASE_TOR='http://6wyvgarb3kht6umsqdjrkmwxhfobre24cr6bkmjszu4ngtuezjd45mqd.onion/' filepath=$1 title=`sed -n -e'//s/^.*<title>//p' $filepath | sed -es'/<.*$//'` -filename=`echo $1 | sed 's/^.*\///'` +filename=`echo $1 | sed 's/^src\///'` echo "$title" echo "I2P: ${BASE_I2P}${filename}" diff --git a/src/include/publicdomain.html b/src/publicdomain.html similarity index 100% rename from src/include/publicdomain.html rename to src/publicdomain.html