From ee0879ef794586da4e839b77b6f82813a5072b0d Mon Sep 17 00:00:00 2001 From: Mez Date: Fri, 29 Aug 2025 19:57:44 +0100 Subject: [PATCH] Fix 04b src when the site is in a subfolder --- .gitignore | 2 ++ build/font.css | 7 +++++++ build/style.css | 8 -------- colors.py | 3 +++ setup.py | 7 +++++++ 5 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 build/font.css diff --git a/.gitignore b/.gitignore index a44f07e..79522fa 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ 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/build/font.css b/build/font.css new file mode 100644 index 0000000..49c5495 --- /dev/null +++ b/build/font.css @@ -0,0 +1,7 @@ +@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 78ba97e..00d0186 100644 --- a/build/style.css +++ b/build/style.css @@ -1,11 +1,3 @@ -@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 ff70508..7f95b9f 100644 --- a/colors.py +++ b/colors.py @@ -667,6 +667,9 @@ 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")