Add optional link to a page of choice
This commit is contained in:
parent
32da5452ed
commit
4f280d65fe
3 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
- =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
|
||||
- =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
|
||||
|
|
|
@ -131,7 +131,10 @@ def indexgen():
|
|||
else:
|
||||
rank = "red"
|
||||
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
|
||||
crayorange = 0
|
||||
crayyellow = 0
|
||||
|
|
|
@ -14,4 +14,6 @@ tradestatement = ""
|
|||
maxmastered = 20
|
||||
ownedpage = False
|
||||
firstmasteries = ["deckname","nameofdeck"]
|
||||
misclink = {"link":"","text":""}
|
||||
donations = {"decks":[],"scrapbook":[]}
|
||||
masscollect = {"series":{"full":True,"decks":["firstdeck","seconddeck"],"singles":["card01","card02"]}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue