You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
2.1 KiB
Python

import variables
4 weeks ago
def headerwrite(thefile,pagename):
header = open(thefile,"a")
header.write("<!DOCTYPE html>\n<html lang=\"en\" style=\"--headbg:" + variables.headerbackground + ";\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <link rel=\"stylesheet\" href=\"/style.css\">\n <link rel=\"stylesheet\" href=\"/user.css\">\n <meta name=\"theme-color\" content=\"" + variables.headerbackground + "\">\n <title>" + variables.name + "s card collection :: " + pagename + "</title>\n </head>\n <body>\n <aside>\n \n </aside>\n <nav>\n <ul>\n <li>")
4 weeks ago
if pagename == "index":
header.write("home")
else:
header.write("<a href=\"/\">home</a>")
header.write("</li>\n <li>")
if pagename == "collecting":
header.write("collecting")
else:
header.write("<a href=\"/collecting\">collecting</a>")
header.write("</li>\n <li>")
if pagename == "mastered":
header.write("mastered")
else:
header.write("<a href=\"/mastered\">mastered</a>")
header.write("</li>\n <li>")
4 weeks ago
if pagename == "owned":
header.write("owned")
else:
header.write("<a href=\"/owned\">owned</a>")
header.write("</li>\n <li>")
3 weeks ago
if pagename == "trade":
header.write("trading")
else:
header.write("<a href=\"/trade\">trading</a>")
header.write("</li>\n <li>")
4 weeks ago
if pagename == "wanted":
header.write("wanted")
else:
header.write("<a href=\"/wanted\">wanted</a>")
header.write("</li>\n <li>")
if pagename == "log":
header.write("log")
else:
header.write("<a href=\"/log\">log</a>")
header.write("</li>\n <li><a href=\"" + variables.tradepost + "\" target=\"_blank\">trade post @ dw</a></li>\n <li><a href=\"https://colors-tcg.eu/services.php\" target=\"_blank\">service links</a></li>\n </ul>\n </nav>\n <main>\n")
4 weeks ago
header.close()
def footerwrite(thefile):
footer = open(thefile,"a")
footer.write(" </main>\n </body>\n</html>")
footer.close()