Add support for image based buttons. see sites/y2kfan.net for examples.
This commit is contained in:
parent
4bbf327d35
commit
640f5d2848
45
build.sh
45
build.sh
|
@ -166,6 +166,42 @@ make_news_header()
|
|||
echo "</table>" >> "$2"
|
||||
}
|
||||
|
||||
# arguments: site, page side, page, title
|
||||
site_button()
|
||||
{
|
||||
if [ "$2" = "news" ]
|
||||
then
|
||||
BTN_SEARCHPATH="./sites/$1/news"
|
||||
BTN_NAME="news"
|
||||
else
|
||||
BTN_SEARCHPATH="./sites/$1/$2/$3"
|
||||
BTN_NAME="$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_NAME.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_NAME.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_NAME.html\"><img src=\"$BTN_NAME.png\"></a><br>"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "<a href=\"$3.html\">• $4</a><br>"
|
||||
}
|
||||
|
||||
# arguments: site-name (folder inside ./sites)
|
||||
site_process()
|
||||
{
|
||||
|
@ -190,7 +226,8 @@ site_process()
|
|||
saferm "$TMP_PAGES_L"
|
||||
|
||||
# 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
|
||||
if [ -d "./sites/$1/pages_right" ]
|
||||
|
@ -206,7 +243,8 @@ site_process()
|
|||
continue
|
||||
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
|
||||
fi
|
||||
|
||||
|
@ -224,7 +262,8 @@ site_process()
|
|||
continue
|
||||
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
|
||||
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