Add support for image based buttons. see sites/y2kfan.net for examples.

This commit is contained in:
Marco Cawthorne 2023-03-25 18:17:05 -07:00
parent 4bbf327d35
commit 503b69e99a
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
5 changed files with 44 additions and 3 deletions

View File

@ -166,6 +166,44 @@ 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"
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\">&#8226; $4</a><br>"
}
# arguments: site-name (folder inside ./sites)
site_process()
{
@ -190,7 +228,8 @@ site_process()
saferm "$TMP_PAGES_L"
# before we collect all pages, add a 'News' button:
echo "<a href=\"index.html\">&#8226; News</a><br>" >> "$TMP_PAGES_L"
site_button "$1" "news" "index" "News" >> "$TMP_PAGES_L"
#echo "<a href=\"index.html\">&#8226; News</a><br>" >> "$TMP_PAGES_L"
# enumerate and list the right-aligned pages
if [ -d "./sites/$1/pages_right" ]
@ -206,7 +245,8 @@ site_process()
continue
fi
echo "<a href=\"$ID_NAME.html\">&#8226; $TITLE</a><br>" >> "$TMP_PAGES_R"
site_button "$1" "pages_right" "$ID_NAME" "$TITLE" >> "$TMP_PAGES_R"
#echo "<a href=\"$ID_NAME.html\">&#8226; $TITLE</a><br>" >> "$TMP_PAGES_R"
done
fi
@ -224,7 +264,8 @@ site_process()
continue
fi
echo "<a href=\"$ID_NAME.html\">&#8226; $TITLE</a><br>" >> "$TMP_PAGES_L"
site_button "$1" "pages_left" "$ID_NAME" "$TITLE" >> "$TMP_PAGES_L"
#echo "<a href=\"$ID_NAME.html\">&#8226; $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