Show donations on index page
This commit is contained in:
parent
4f280d65fe
commit
7bb5848455
2 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
- =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
|
||||
- =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:
|
||||
#+BEGIN_SRC bash
|
||||
|
|
20
indexgen.py
20
indexgen.py
|
@ -303,6 +303,26 @@ def indexgen():
|
|||
content.write("\" title=\"" + str(value) + " left\"")
|
||||
content.write(" loading=\"lazy\">")
|
||||
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()
|
||||
skel.footerwrite(thefile)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue