diff --git a/.gitignore b/.gitignore index 79522fa..a44f07e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,6 @@ build/index.html build/decks/*/*.gif build/decks/*/type build/assets/banner.png -build/assets/fonts/* -!build/assets/fonts/04b24.ttf build/assets/header.png build/assets/levels/*.gif build/assets/sketch/*.gif diff --git a/README.org b/README.org index c952b7b..890cf43 100644 --- a/README.org +++ b/README.org @@ -4,12 +4,9 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards ** Instructions *** Requirements - =python3= (needs the following libraries: =bs4, collections, datetime, itertools, os, random, re, requests=) -- either: - - server space - - subdomain pointing to your site root on the server - - =rclone= with your server set up as a remote -- or: - - a neocities account with the [[https://neocities.org/cli][neocities CLI]] installed +- server space +- subdomain pointing to your site root on the server +- =rclone= with your server set up as a remote *** Setup - Download and create the initial files by running: #+BEGIN_SRC bash @@ -20,10 +17,9 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards cp trade-template.py trade.py #+END_SRC - Edit =variables.py= to set the variables as follows: - - =neocities=: set to =True= if you will be using the neocities CLI - - =servername=: name set for your remote in =rclone= (if not using the neocities CLI) - - =serverpath=: path to the site root on the server (if not using the neocities CLI; with leading slash, without trailing slash) - - =subfolder=: subfolder under your (sub)domain in which the TCG pages will be located (leave as an empty string if they are at the top level; if using the neocities CLI this will not work and the pages will be uploaded to the site root) + - =servername=: name set for your remote in =rclone= + - =serverpath=: path to the site root on the server (with leading slash, without trailing slash) + - =subfolder=: subfolder under your (sub)domain in which the TCG pages will be located (leave as an empty string if they are at the top level) - =url=: URL of your site index page including =https://= - =name=: the name you use in the game - =hovertext=: text to display when hovering over the header image diff --git a/build/font.css b/build/font.css deleted file mode 100644 index 49c5495..0000000 --- a/build/font.css +++ /dev/null @@ -1,7 +0,0 @@ -@font-face { - src: url("/assets/fonts/04b24.ttf"); - font-display: swap; - font-family: "04b24"; - font-style: normal; - font-weight: 400; -} diff --git a/build/style.css b/build/style.css index 00d0186..78ba97e 100644 --- a/build/style.css +++ b/build/style.css @@ -1,3 +1,11 @@ +@font-face { + src: url("/assets/fonts/04b24.ttf"); + font-display: swap; + font-family: "04b24"; + font-style: normal; + font-weight: 400; +} + /* basic colours */ :root { diff --git a/colors.py b/colors.py index 7f95b9f..797f766 100644 --- a/colors.py +++ b/colors.py @@ -6,24 +6,22 @@ import log,variables values = ["red","orange","yellow","green","blue","purple","brown","gray","special","limited"] numbers = ["01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20"] +print("Getting list of deck colours") + deckkey = {} -try: - request = requests.get("https://colors-tcg.eu/cards.php?view=alpha") - print("Getting list of deck colours") - alldecks = open("key.html","w") - alldecks.write(request.text) - alldecks.close() +request = requests.get("https://colors-tcg.eu/cards.php?view=alpha") +alldecks = open("key.html","w") +alldecks.write(request.text) +alldecks.close() - # need to correct some html issues +# need to correct some html issues - with open("key.html","r") as file: - filedata = file.read() - filedata = filedata.replace("","") - with open("key.html","w") as file: - file.write(filedata) -except: - print("Using cached version of decklist") +with open("key.html","r") as file: + filedata = file.read() +filedata = filedata.replace("","") +with open("key.html","w") as file: + file.write(filedata) with open("key.html") as decks: decksoup = BeautifulSoup(decks, "html.parser") @@ -667,9 +665,6 @@ if variables.keepsig == True: def headerwrite(thefile,pagename): header = open(thefile,"a") header.write("\n\n \n \n \n 0: - header.write("/" + variables.subfolder) - header.write("/font.css\">\n 0: header.write("/" + variables.subfolder) header.write("/style.css\">\n 0: - header.write("/" + variables.subfolder) -fontloc.write("/assets/fonts/04b24.ttf\");\n font-display: swap;\n font-family: \"04b24\";\n font-style: normal;\n font-weight: 400;\n}\n") -fontloc.close() - if not os.path.exists("build/user.css"): open("build/user.css","x") diff --git a/variables-template.py b/variables-template.py index b32da46..0ed904e 100644 --- a/variables-template.py +++ b/variables-template.py @@ -1,4 +1,3 @@ -neocities = False servername = "" serverpath = "" subfolder = ""