Add support for image based buttons. see sites/y2kfan.net for examples.
This commit is contained in:
parent
4bbf327d35
commit
503b69e99a
47
build.sh
47
build.sh
|
@ -166,6 +166,44 @@ make_news_header()
|
||||||
echo "</table>" >> "$2"
|
echo "</table>" >> "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# arguments: site, page side, page, title
|
||||||
|
site_button()
|
||||||
|
{
|
||||||
|
if [ "$2" = "news" ]
|
||||||
|
then
|
||||||
|
BTN_SEARCHPATH="./sites/$1/news"
|
||||||
|
BTN_NAME="news"
|
||||||
|
BTN_PAGE="index"
|
||||||
|
else
|
||||||
|
BTN_SEARCHPATH="./sites/$1/$2/$3"
|
||||||
|
BTN_NAME="$3"
|
||||||
|
BTN_PAGE="$3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$BTN_SEARCHPATH/$BTN_NAME.gif" ]
|
||||||
|
then
|
||||||
|
cp "$BTN_SEARCHPATH/$BTN_NAME.gif" "./out/$1/$BTN_NAME.gif"
|
||||||
|
echo "<a href=\"$BTN_PAGE.html\"><img src=\"$BTN_NAME.gif\"></a><br>"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$BTN_SEARCHPATH/$BTN_NAME.jpg" ]
|
||||||
|
then
|
||||||
|
cp "$BTN_SEARCHPATH/$BTN_NAME.jpg" "./out/$1/$BTN_NAME.jpg"
|
||||||
|
echo "<a href=\"$BTN_PAGE.html\"><img src=\"$BTN_NAME.jpg\"></a><br>"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$BTN_SEARCHPATH/$BTN_NAME.png" ]
|
||||||
|
then
|
||||||
|
cp "$BTN_SEARCHPATH/$BTN_NAME.png" "./out/$1/$BTN_NAME.png"
|
||||||
|
echo "<a href=\"$BTN_PAGE.html\"><img src=\"$BTN_NAME.png\"></a><br>"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "<a href=\"$BTN_PAGE.html\">• $4</a><br>"
|
||||||
|
}
|
||||||
|
|
||||||
# arguments: site-name (folder inside ./sites)
|
# arguments: site-name (folder inside ./sites)
|
||||||
site_process()
|
site_process()
|
||||||
{
|
{
|
||||||
|
@ -190,7 +228,8 @@ site_process()
|
||||||
saferm "$TMP_PAGES_L"
|
saferm "$TMP_PAGES_L"
|
||||||
|
|
||||||
# before we collect all pages, add a 'News' button:
|
# before we collect all pages, add a 'News' button:
|
||||||
echo "<a href=\"index.html\">• News</a><br>" >> "$TMP_PAGES_L"
|
site_button "$1" "news" "index" "News" >> "$TMP_PAGES_L"
|
||||||
|
#echo "<a href=\"index.html\">• News</a><br>" >> "$TMP_PAGES_L"
|
||||||
|
|
||||||
# enumerate and list the right-aligned pages
|
# enumerate and list the right-aligned pages
|
||||||
if [ -d "./sites/$1/pages_right" ]
|
if [ -d "./sites/$1/pages_right" ]
|
||||||
|
@ -206,7 +245,8 @@ site_process()
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "<a href=\"$ID_NAME.html\">• $TITLE</a><br>" >> "$TMP_PAGES_R"
|
site_button "$1" "pages_right" "$ID_NAME" "$TITLE" >> "$TMP_PAGES_R"
|
||||||
|
#echo "<a href=\"$ID_NAME.html\">• $TITLE</a><br>" >> "$TMP_PAGES_R"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -224,7 +264,8 @@ site_process()
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "<a href=\"$ID_NAME.html\">• $TITLE</a><br>" >> "$TMP_PAGES_L"
|
site_button "$1" "pages_left" "$ID_NAME" "$TITLE" >> "$TMP_PAGES_L"
|
||||||
|
#echo "<a href=\"$ID_NAME.html\">• $TITLE</a><br>" >> "$TMP_PAGES_L"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Loading…
Reference in New Issue