Show donations on index page

master
trémeur 2 weeks ago
parent 4f280d65fe
commit 7bb5848455

@ -33,6 +33,7 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards
- =ownedpage=: =True= if you want a page displaying your entire collection, =False= otherwise - =ownedpage=: =True= if you want a page displaying your entire collection, =False= otherwise
- =firstmasteries=: a list of decks you mastered first - =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 - =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
- =masscollect=: list (python dict) of series/themes being mass collected, each containing a dict which specifies =“full”= as either =True= or =False= (to show or hide a list of the total number of cards in the set) and contains at least one of ="decks"= specifying a list of decks, or ="singles"= specifying a list of individual cards - =masscollect=: list (python dict) of series/themes being mass collected, each containing a dict which specifies =“full”= as either =True= or =False= (to show or hide a list of the total number of cards in the set) and contains at least one of ="decks"= specifying a list of decks, or ="singles"= specifying a list of individual cards
- Run the following: - Run the following:
#+BEGIN_SRC bash #+BEGIN_SRC bash

@ -303,6 +303,26 @@ def indexgen():
content.write("\" title=\"" + str(value) + " left\"") content.write("\" title=\"" + str(value) + " left\"")
content.write(" loading=\"lazy\">") content.write(" loading=\"lazy\">")
content.write("</p>\n") content.write("</p>\n")
donations = []
try:
for deck in variables.donations["decks"]:
donations.append(deck + "00")
except:
pass
try:
for card in variables.donations["scrapbook"]:
donations.append(card)
except:
pass
if len(donations) > 0:
donations = sorted(donations)
content.write("<h2>donations</h2>\n<p>")
for donation in donations:
if donation[-2:] == "00":
content.write("<img src=\"/decks/" + donation[:-2] + "/00.gif\" loading=\"lazy\">")
else:
content.write(tcgcore.printcard(card))
content.write("</p>\n")
content.close() content.close()
skel.footerwrite(thefile) skel.footerwrite(thefile)

Loading…
Cancel
Save