From 4bbb265342dcc215c1f2451da6d54c2bbb8a6992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Mon, 21 Apr 2025 12:13:15 +0100 Subject: [PATCH] Add fallbacks for small collections --- README.org | 2 +- colors.py | 36 ++-- setup.py | 1 + tools.py | 413 +++++++++++++++++++++++++----------------- variables-template.py | 4 +- 5 files changed, 264 insertions(+), 192 deletions(-) diff --git a/README.org b/README.org index 669fcdb..67789fb 100644 --- a/README.org +++ b/README.org @@ -21,6 +21,7 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards - =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 + - =sig=: set to =True= when you have a signature card - =highpriority=: a list of high priority decks you’re collecting - =trademedium=: whether to allow trading medium-priority cards away in exchange for high-priority cards - =tradepost=: URL of your trade post on Dreamwidth @@ -35,7 +36,6 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards - =keepsig=: =True= if you always want to keep one copy of your signature, =False= if you want to make them all available for trading - =tradestatement=: statement to place on your trading page - =maxmastered=: maximum number of most recently mastered decks to show on the index page - - =ownedpage=: =True= if you want a page displaying your entire collection, =False= otherwise - =firstmasteries=: a list of decks you mastered first - =misclink=: under ="link"=, a link to any page you choose, and under ~"text"~, text to display as the link - =donations= : lists of donated decks and individual scrapbook cards diff --git a/colors.py b/colors.py index 183c14e..1b5a7b4 100644 --- a/colors.py +++ b/colors.py @@ -476,18 +476,7 @@ def headerwrite(thefile,pagename): if len(variables.subfolder) > 0: header.write("/" + variables.subfolder) header.write("/mastered\">mastered") - header.write("\n") - if variables.ownedpage: - header.write("
  • ") - if pagename == "owned": - header.write("owned") - else: - header.write(" 0: - header.write("/" + variables.subfolder) - header.write("/owned\">owned") - header.write("
  • \n") - header.write("
  • ") + header.write("
  • \n
  • ") if pagename == "trade": header.write("trading") else: @@ -1138,12 +1127,23 @@ def indexgen(): content.write("/levels\"> 0: content.write("/" + variables.subfolder) - content.write("/assets/levels/" + rankcode + ".gif\"> 0: - content.write("/" + variables.subfolder) - content.write("/decks/sigs/" + variables.name.lower() + ".gif\" loading=\"lazy\">\n