Add links to singles pages and to fedi posts where applicable

master
trémeur 9 months ago
parent afb4f2cbe4
commit f758ec46ad

@ -22,11 +22,11 @@ Requisites: =rclone= (just for uploading files to the server), Python 3.
- some but not all of my fics are on AO3; HTML, PDF and EPUB formats exist for most, but this can be adjusted for individual entries as needed
- whether commenting is enabled on a particular fic depends on a couple of factors
** Future plans [2/6]
** Future plans [3/6]
- [X] +redirect to a consent page using local storage (h/t [[https://www.fancoders.com/][Fandom Coders]])+
- [ ] pages for times and locations in FF fandoms
- [X] +possibly a page for non-FF fandoms (as if I even care about these lol)+
- [ ] python-based browser for loading in fic metadata and grabbing stats (“what were my top ships in 2022” etc.)
- [ ] python-based browser for loading in fic metadata and grabbing stats (“what were my top ships in 2022” etc.) in progress
- [ ] drabble wall
- [ ] link to singles pages from headers? on the number?
- [X] +link to singles pages from headers? on the number?+

@ -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>")

@ -39,6 +39,7 @@ locked = False
html = True
pdf = True
epub = True
# fedislug = ""
# comments = [{"site":"", # ao3, dw, lj, discord
# "registered":, # True or False, not required for discord
# "username":"", # leave out if its a dw/lj anon

Loading…
Cancel
Save