Add CC licence to index page, add wordcounts to fandom list
This commit is contained in:
parent
e831481733
commit
1eb36343e3
2 changed files with 8 additions and 3 deletions
|
@ -53,6 +53,7 @@ def fandomlist(local=False):
|
|||
fandomlist = sorted(fandomlist, key=lambda d: d["sortname"])
|
||||
for fandom in fandomlist:
|
||||
fandomfics = []
|
||||
fandomwords = 0
|
||||
sortfics = []
|
||||
# check which fics are in the fandom
|
||||
ficcount = 500
|
||||
|
@ -76,11 +77,15 @@ def fandomlist(local=False):
|
|||
revealed = True
|
||||
if revealed == True:
|
||||
if fandom["searchname"] in fileread.fandom:
|
||||
ficdict = {"thefic":ficcount,"thedate":(fileread.datewords[-1])["date"]}
|
||||
sumwords = 0
|
||||
for instalment in fileread.datewords:
|
||||
sumwords = sumwords + instalment["words"]
|
||||
ficdict = {"thefic":ficcount,"thedate":(fileread.datewords[-1])["date"],"totalwords":sumwords}
|
||||
sortfics.append(ficdict)
|
||||
thefics = sorted(sortfics,key=lambda d: d["thedate"],reverse=True)
|
||||
for fic in thefics:
|
||||
fandomfics.append(fic["thefic"])
|
||||
fandomwords = fandomwords + fic["totalwords"]
|
||||
firstfic = fandomfics[-1]
|
||||
if firstfic < 10:
|
||||
firstficstring = "00" + str(firstfic)
|
||||
|
@ -111,7 +116,7 @@ def fandomlist(local=False):
|
|||
filewrite.write("<details><summary><b>" + fandom["displayname"] + "</b> (" + str(len(fandomfics)) + " fic")
|
||||
if len(fandomfics) > 1:
|
||||
filewrite.write("s")
|
||||
filewrite.write(", " + yearstring + ")</summary>\n")
|
||||
filewrite.write(", " + f"{fandomwords:,}" + " total words, " + yearstring + ")</summary>\n")
|
||||
filewrite.close()
|
||||
for fic in fandomfics:
|
||||
makeheader.ficgen(fic,False,output,local)
|
||||
|
|
|
@ -58,7 +58,7 @@ def indexgen(local=False):
|
|||
# write header
|
||||
headerfooter.headerwrite("build/index.html","Tré’s fic archive","Tré’s fic archive","",True,local)
|
||||
filewrite = open("build/index.html", "a")
|
||||
filewrite.write("<p>Here is all my fanfiction! Some of it is also syndicated elsewhere, but this site is the canonical location for everything I’ve written. I authorise transformative works as long as the original is linked and no financial transactions are involved.</p>\n<p>The code for this archive is available <a href=\"https://git.praze.net/tre/fic-archive\">here</a>. Commenting is switched on for most fics written at least semi-recently – read about that <a href=\"")
|
||||
filewrite.write("<p>Here is all my fanfiction! Some of it is also syndicated elsewhere, but this site is the canonical location for everything I’ve written.</p>\n<p xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dct=\"http://purl.org/dc/terms/\"><strong>Transformative works policy:</strong> The contents of <a property=\"dct:title\" rel=\"cc:attributionURL\" href=\"https://tre.praze.net/fic\">these pages</a> are licensed under <a href=\"https://creativecommons.org/licenses/by-nc/4.0/\" target=\"_blank\" rel=\"license\" style=\"display:inline-block;\">CC BY-NC 4.0. <img style=\"height:22px!important;margin-left:3px;vertical-align:middle;\" src=\"https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1\" alt=\"\"><img style=\"height:22px!important;margin-left:3px;vertical-align:middle;\" src=\"https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1\" alt=\"\"><img style=\"height:22px!important;margin-left:3px;vertical-align:middle;\" src=\"https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1\" alt=\"\"></a> In other words, transformative works are permitted as long as there is a clearly visible hyperlink to the original and no financial transactions are involved.</p>\n<p>The code for this archive is available <a href=\"https://git.praze.net/tre/fic-archive\">here</a>. Commenting is switched on for most fics written at least semi-recently – read about that <a href=\"")
|
||||
if local:
|
||||
filewrite.write("comments/index.html")
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue