From 1830a5f64db3a90e0b72f6a868ac6ce261642e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Sat, 1 Feb 2025 14:29:09 +0000 Subject: [PATCH] Open external links in new tabs, set correct dates for RSS feed --- build/archive.css | 11 +++++++++-- events.py | 6 +++--- feed.py | 3 +-- headerfooter.py | 2 +- indexgen.py | 2 +- makeheader.py | 46 ++++++++++++++++++++++++---------------------- statsgen.py | 16 ++++++++-------- 7 files changed, 47 insertions(+), 39 deletions(-) diff --git a/build/archive.css b/build/archive.css index a6cc133..79674d3 100644 --- a/build/archive.css +++ b/build/archive.css @@ -135,12 +135,19 @@ div.fic h1 span.ficnoprelim { font-size: 0.6em; } -div.fic h1 span.abandoned { +div.fic h1 span.abandoned, div.fic h1 span.incomplete { font-weight: normal; - background-color: #9c0000; color: white; } +div.fic h1 span.abandoned { + background-color: #9c0000; +} + +div.fic h1 span.incomplete { + background-color: #8ab60b; +} + div.fic ul.ficlinks li, div.fic ul.ficmeta li { list-style: none; } diff --git a/events.py b/events.py index 1c8b821..bb948b2 100644 --- a/events.py +++ b/events.py @@ -86,11 +86,11 @@ def eventlist(local=False): position += 1 eventlocation = (eventlist[position])["location"] if eventlocation == "dwjournal": - filewrite.write("\"[personal" + theevent.replace("-","_")+ "") + filewrite.write("\"[personal" + theevent.replace("-","_")+ "") elif eventlocation == "dwcomm": - filewrite.write("\"[community" + theevent.replace("-","_") + "") + filewrite.write("\"[community" + theevent.replace("-","_") + "") elif eventlocation == "ljjournal": - filewrite.write("\"[personal" + theevent.replace("-","_")+ "") + filewrite.write("\"[personal" + theevent.replace("-","_")+ "") else: filewrite.write(theevent) filewrite.write(" (" + str(len(evententries)) + ": " + ", ".join(eventfandoms) + ")\n") diff --git a/feed.py b/feed.py index 7ce5c91..cb234ca 100644 --- a/feed.py +++ b/feed.py @@ -160,8 +160,7 @@ def feedgen(local=False): filewrite.write(", " + thegenre) genred = True filewrite.write("\n") - futuredate = date + datetime.timedelta(days=2) - filewrite.write(futuredate.strftime("%a, %-d %b %Y")) + filewrite.write(date.strftime("%a, %-d %b %Y")) filewrite.write(" 00:00:00 GMT\n") if local: filewrite.write("/home/mdd/Documents/proj/fic-archive/build/") diff --git a/headerfooter.py b/headerfooter.py index 02cb828..b8c8d0e 100644 --- a/headerfooter.py +++ b/headerfooter.py @@ -39,5 +39,5 @@ def footerwrite(output,main=False,local=False): footer.write("/home/mdd/Documents/proj/fic-archive/build/") else: footer.write("/fic/") - footer.write("verify/index.html?returnto=${window.location}`; }\n\n\n") + footer.write("verify/index.html?returnto=${window.location}`; }\n\n\n") footer.close() diff --git a/indexgen.py b/indexgen.py index f71da44..c8a245e 100644 --- a/indexgen.py +++ b/indexgen.py @@ -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("

Here is all my fanfiction! Some of it is also syndicated elsewhere, but this site is the canonical location for everything I’ve written.

\n

Transformative works policy: The contents of these pages are licensed under CC BY-NC 4.0. \"\"\"\"\"\" 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.

\n

The code for this archive is available here. Commenting is switched on for most fics written at least semi-recently – read about that Here is all my fanfiction! Some of it is also syndicated elsewhere, but this site is the canonical location for everything I’ve written.

\n

Transformative works policy: The contents of these pages are licensed under CC BY-NC 4.0. \"\"\"\"\"\" 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.

\n

The code for this archive is available here. Commenting is switched on for most fics written at least semi-recently – read about that \n") # write html link if there is one if fileread.html: - filewrite.write("

  • HTML
  • \n") # write pdf link if there is one if fileread.pdf: - filewrite.write("
  • PDF
  • \n") # write epub link if there is one if fileread.epub: - filewrite.write("
  • \n") # write html link if there is one if fileread.html: - filewrite.write("
  • HTML
  • \n") # write pdf link if there is one if fileread.pdf: - filewrite.write("
  • PDF
  • \n") # write epub link if there is one if fileread.epub: - filewrite.write("
  • AO3
  • \n") @@ -325,6 +325,8 @@ def ficgen(ficno,unique=False,output="output.html",local=False,single=False): pass if fileread.status == "abandoned": filewrite.write(" (abandoned)") + elif fileread.status == "incomplete": + filewrite.write(" (in progress)") filewrite.write("\n
    \n
    \n\n") + filewrite.write("

    \n\n\n") filewrite.close() if __name__ == "__main__":