From 2c877c77e28c17459875e5e7b1e3725f288d9a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Sat, 14 Sep 2024 23:14:57 +0100 Subject: [PATCH] Remove links to dead fedi posts, add header for improved fediverse discoverability --- headerfooter.py | 7 +++++-- makeheader.py | 10 +++++----- single.py | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/headerfooter.py b/headerfooter.py index fe5ed3e..f310b8e 100644 --- a/headerfooter.py +++ b/headerfooter.py @@ -1,11 +1,14 @@ -def headerwrite(output,title,headerone,desc,main=False,local=False): +def headerwrite(output,title,headerone,desc,main=False,local=False,single=False,ficnostring=False): header = open(output, "a") header.write("\n\n\n\n\n\n\n\n\n" + title + "\n\n\n\n\n\n\n\n\n\n\n
\n
\n\n

" + headerone + "

\n" + desc + "\n") + header.write("archive.css\">\n\n\n\n" + title + "\n\n\n\n\n\n\n\n") + if single: + header.write("\n\n\n\n\n
\n
\n\n

" + headerone + "

\n" + desc + "\n") if not main: header.write("

\nfedi\n") - except: - pass + # try: + # filewrite.write("

  • fedi
  • \n") + # except: + # pass # determine if comments page if any(item in fffandoms for item in fileread.fandom): filewrite.write("
  • " + ficnostring + "") try: if translationstring: diff --git a/single.py b/single.py index 1ad3ef9..bb6f612 100644 --- a/single.py +++ b/single.py @@ -34,7 +34,7 @@ def singlepage(ficno,directory,local=False): os.remove(singlepath + "/index.html") # write to output file output = singlepath + "/index.html" - headerfooter.headerwrite(output,"Fic no. " + ficnostring,"Fic no. " + ficnostring + "","",False,local) + headerfooter.headerwrite(output,"Fic no. " + ficnostring,"Fic no. " + ficnostring + "","",False,local,single=True,ficnostring=ficnostring) try: if fileread.original: makeheader.ficgen(fileread.original,False,output,local,True)