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.

60 lines
2.6 KiB
Python

import variables
2 months 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 class=\"" + pagename + "\">\n <aside>\n \n </aside>\n <nav>\n <ul>\n <li>")
2 months 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 == "mass":
header.write("mass collecting")
else:
header.write("<a href=\"/mass\">mass 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")
if variables.ownedpage:
header.write(" <li>")
if pagename == "owned":
header.write("owned")
else:
header.write("<a href=\"/owned\">owned</a>")
header.write("</li>\n")
header.write(" <li>")
2 months ago
if pagename == "trade":
header.write("trading")
else:
header.write("<a href=\"/trade\">trading</a>")
header.write("</li>\n <li>")
2 months ago
if pagename == "wanted":
header.write("wanted")
else:
header.write("<a href=\"/wanted\">wanted</a>")
header.write("</li>\n <li>")
1 month ago
if pagename == "search":
header.write("search")
else:
header.write("<a href=\"/search\">search</a>")
header.write("</li>\n <li>")
2 months ago
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")
2 months ago
header.close()
def footerwrite(thefile):
footer = open(thefile,"a")
footer.write(" </main>\n </body>\n</html>")
footer.close()