Add optional link to a page of choice

master
trémeur 2 weeks ago
parent 32da5452ed
commit 4f280d65fe

@ -32,6 +32,7 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards
- =maxmastered=: maximum number of most recently mastered decks to show on the index 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 - =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
- =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

@ -131,7 +131,10 @@ def indexgen():
else: else:
rank = "red" rank = "red"
rankcode = re.sub(" ","",rank) rankcode = re.sub(" ","",rank)
content.write("<a href=\"/levels\"><img src=\"/assets/levels/" + rankcode + ".gif\"></a>" + tcgcore.printcard("sig_" + variables.name.lower()) + "\n<ul>\n<li>player name: <span class=\"name\">" + variables.name + "</span></li>\n<li>" + str(len(tcgcore.ownedcards())) + " cards held <span class=\"rank " + rank + "\">(" + rank + ")</span></li>\n<li>started <code>" + firstdate.strftime("%Y-%m-%d") + "</code></li>\n<li>last updated <code>" + datetime.datetime.today().strftime("%Y-%m-%d") + "</code></li>\n<li><a href=\"https://git.praze.net/tre/tcg\" target=\"_blank\">code</a> under construction</li>\n</ul>\n") content.write("<a href=\"/levels\"><img src=\"/assets/levels/" + rankcode + ".gif\"></a>" + tcgcore.printcard("sig_" + variables.name.lower()) + "\n<ul>\n<li>player name: <span class=\"name\">" + variables.name + "</span></li>\n<li>" + str(len(tcgcore.ownedcards())) + " cards held <span class=\"rank " + rank + "\">(" + rank + ")</span></li>\n<li>started <code>" + firstdate.strftime("%Y-%m-%d") + "</code></li>\n<li>last updated <code>" + datetime.datetime.today().strftime("%Y-%m-%d") + "</code></li>\n<li><a href=\"https://git.praze.net/tre/tcg\" target=\"_blank\">code</a> under construction</li>\n")
if len(variables.misclink["text"]) > 0:
content.write("<li><a href=\"" + variables.misclink["link"] + "\">" + variables.misclink["text"] + "</a></li>\n")
content.write("</ul>\n")
crayred = 0 crayred = 0
crayorange = 0 crayorange = 0
crayyellow = 0 crayyellow = 0

@ -14,4 +14,6 @@ tradestatement = ""
maxmastered = 20 maxmastered = 20
ownedpage = False ownedpage = False
firstmasteries = ["deckname","nameofdeck"] firstmasteries = ["deckname","nameofdeck"]
misclink = {"link":"","text":""}
donations = {"decks":[],"scrapbook":[]}
masscollect = {"series":{"full":True,"decks":["firstdeck","seconddeck"],"singles":["card01","card02"]}} masscollect = {"series":{"full":True,"decks":["firstdeck","seconddeck"],"singles":["card01","card02"]}}

Loading…
Cancel
Save