Add links to singles pages and to fedi posts where applicable

This commit is contained in:
mez 2024-04-06 19:03:38 +01:00
parent afb4f2cbe4
commit f758ec46ad
3 changed files with 22 additions and 6 deletions

View file

@ -102,6 +102,11 @@ def linkgen(ficno,output="output.html",local=False):
filewrite.write("href=\"https://archiveofourown.org/works/" + str(fileread.ao3slug) + "\">AO3</a></li>\n")
except:
pass
# write fedi share link if there is one
try:
filewrite.write("<li><a href=\"https://ple.praze.net/notice/" + fileread.fedislug + "\">fedi</a></li>\n")
except:
pass
# determine if comments page
if any(item in fffandoms for item in fileread.fandom):
filewrite.write("<li class=\"prazelink\"><a href=\"")
@ -283,10 +288,20 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
# give the div an id if requested
if unique:
filewrite.write(" id=\"fic" + ficnostring + "\"")
filewrite.write(">\n<h1><span class=\"ficnoprelim\">no. </span><span class=\"ficno\">" + ficnostring)
# write ficno including translation if there is one
filewrite.write(">\n<h1><span class=\"ficnoprelim\">no. </span><span class=\"ficno\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/single/" + ficnostring + "/index.html")
else:
filewrite.write("/fic/single/" + ficnostring)
filewrite.write("\">" + ficnostring + "</a>")
try:
filewrite.write("/" + translationstring)
if translationstring:
filewrite.write("/<a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/single/" + translationstring + "/index.html")
else:
filewrite.write("/fic/single/" + translationstring)
filewrite.write("\">" + translationstring + "</a>")
except:
pass
filewrite.write("</span>")