Account for local filesystem change; change wording on gateway page; add link to tei’s ficring

master
trémeur 5 months ago
parent 9d07e5d2f7
commit 9fa87b5955

@ -164,7 +164,7 @@ def feedgen(local=False):
filewrite.write(futuredate.strftime("%a, %-d %b %Y"))
filewrite.write(" 00:00:00 GMT</pubDate>\n<link>")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/")
else:
filewrite.write("https://tre.praze.net/fic/")
filewrite.write("single/" + ficcountstring)

@ -2,14 +2,14 @@ def headerwrite(output,title,headerone,desc,main=False,local=False):
header = open(output, "a")
header.write("<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<link rel=\"stylesheet\" href=\"")
if local:
header.write("/home/mdd/Documents/drive/proj/fic-archive/build/")
header.write("/home/mdd/Documents/proj/fic-archive/build/")
else:
header.write("/fic/")
header.write("archive.css\">\n<link rel=\"me\" href=\"https://ple.praze.net/users/tre\">\n<link rel=\"alternate\" type=\"application/rss+xml\" title=\"Tré's fic archive\" href=\"https://tre.praze.net/fic/feed.xml\">\n<meta name=\"theme-color\" content=\"#edc4c4\" />\n<title>" + title + "</title>\n<noscript>\n<style>.jsonly{display:none;}</style>\n</noscript>\n</head>\n<body>\n<div id=\"content\">\n<div id=\"inside\">\n<noscript>\n<div id=\"warning\">\n<p><b>Warning:</b> this part of my site is <b>18+</b>. Fics contain NSFW material and mature themes (death, suicide, mental illness, incest …). Browse at your own risk.</p>\n</div>\n</noscript>\n<h1>" + headerone + "</h1>\n" + desc + "\n")
if not main:
header.write("<p>\n<a href=\"")
if local:
header.write("/home/mdd/Documents/drive/proj/fic-archive/build/index.html")
header.write("/home/mdd/Documents/proj/fic-archive/build/index.html")
else:
header.write("/fic")
header.write("\">main page\n</a>\n</p>\n")
@ -22,18 +22,18 @@ def footerwrite(output,main=False,local=False):
if not main:
footer.write("<p>\n<a href=\"")
if local:
footer.write("/home/mdd/Documents/drive/proj/fic-archive/build/index.html")
footer.write("/home/mdd/Documents/proj/fic-archive/build/index.html")
else:
footer.write("/fic")
footer.write("\">main page\n</a>\n</p>\n")
footer.write("<img src=\"")
if local:
footer.write("/home/mdd/Documents/drive/proj/fic-archive/build/emacs.jpg")
footer.write("/home/mdd/Documents/proj/fic-archive/build/emacs.jpg")
else:
footer.write("/fic/emacs.jpg")
footer.write("\">\n</footer>\n</div>\n<script>\nif (localStorage.getItem(\"ageVerified\") == null) { window.location = `")
if local:
footer.write("/home/mdd/Documents/drive/proj/fic-archive/build/")
footer.write("/home/mdd/Documents/proj/fic-archive/build/")
else:
footer.write("/fic/")
footer.write("verify/index.html?returnto=${window.location}`; }\n</script>\n</body>\n</html>")

@ -38,7 +38,7 @@ def statslist(local=False):
for year in yearlist:
statstring = ""
if local == True:
statspath = "/home/mdd/Documents/drive/proj/fic-archive/build/stats/" + str(year) + "/index.html"
statspath = "/home/mdd/Documents/proj/fic-archive/build/stats/" + str(year) + "/index.html"
else:
statspath = "/fic/stats/" + str(year)
if yearlist.index(year) > 0:
@ -96,7 +96,7 @@ def indexgen(local=False):
filewrite.write("events/index.html")
else:
filewrite.write("/fic/events")
filewrite.write("\">Events</a></h2>\n<p>Ive been participating in fandom exchanges and other events since late 2020. Most fics I write these days that arent in FF fandoms are in this category (although a lot of the FF ones are as well).</p>\n</div>\n<div class=\"fic\">\n<h2>Other</h2>\n<ul>\n<li>Stats by year: " + (str(statslist(local))) + "</li>\n</ul>\n</div>\n")
filewrite.write("\">Events</a></h2>\n<p>Ive been participating in fandom exchanges and other events since late 2020. Most fics I write these days that arent in FF fandoms are in this category (although a lot of the FF ones are as well).</p>\n</div>\n<div class=\"fic\">\n<h2>Other</h2>\n<ul>\n<li>Stats by year: " + (str(statslist(local))) + "</li>\n</ul>\n</div>\n<div align=\"center\">\n<script>\ndocument.write('<script src=\"https://ficring.neocities.org/ring.js\"><\/script>');\n</script>\n</div>\n")
filewrite.close()
headerfooter.footerwrite("build/index.html",True,local)

@ -50,12 +50,12 @@ def linkgen(ficno,output="output.html",local=False):
if fileread.locked:
filewrite.write("class=\"locked\" href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/")
else:
filewrite.write("/fic/secret/")
else:
if local:
filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/")
filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/")
else:
filewrite.write("href=\"/fic/files/")
filewrite.write(ficnostring + ".html\">HTML</a></li>\n")
@ -65,12 +65,12 @@ def linkgen(ficno,output="output.html",local=False):
if fileread.locked:
filewrite.write("class=\"locked\" href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/")
else:
filewrite.write("/fic/secret/")
else:
if local:
filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/")
filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/")
else:
filewrite.write("href=\"/fic/files/")
filewrite.write(ficnostring + ".pdf\">PDF</a></li>\n")
@ -80,12 +80,12 @@ def linkgen(ficno,output="output.html",local=False):
if fileread.locked:
filewrite.write("class=\"locked\" href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/")
else:
filewrite.write("/fic/secret/")
else:
if local:
filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/")
filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/")
else:
filewrite.write("href=\"/fic/files/")
filewrite.write(ficnostring + ".epub\">EPUB</a></li>\n")
@ -111,7 +111,7 @@ def linkgen(ficno,output="output.html",local=False):
if any(item in fffandoms for item in fileread.fandom):
filewrite.write("<li class=\"prazelink\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/comments/" + ficnostring + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/comments/" + ficnostring + "/index.html")
else:
filewrite.write("/fic/comments/" + ficnostring)
filewrite.write("\">comments</a></li>\n")
@ -120,7 +120,7 @@ def linkgen(ficno,output="output.html",local=False):
if timeelapsed.days < 730:
filewrite.write("<li class=\"prazelink\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/comments/" + ficnostring + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/comments/" + ficnostring + "/index.html")
else:
filewrite.write("/fic/comments/" + ficnostring)
filewrite.write("\">comments</a></li>\n")
@ -129,7 +129,7 @@ def linkgen(ficno,output="output.html",local=False):
if fileread.event == "ao3exchange" and (fileread.datewords[0])["date"].year > 2019:
filewrite.write("<li class=\"prazelink\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/comments/" + ficnostring + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/comments/" + ficnostring + "/index.html")
else:
filewrite.write("/fic/comments/" + ficnostring)
filewrite.write("\">comments</a></li>\n")
@ -138,7 +138,7 @@ def linkgen(ficno,output="output.html",local=False):
if fileread.comments:
filewrite.write("<li class=\"prazelink\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/comments/" + ficnostring + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/comments/" + ficnostring + "/index.html")
else:
filewrite.write("/fic/comments/" + ficnostring)
filewrite.write("\">comments</a></li>\n")
@ -149,7 +149,7 @@ def linkgen(ficno,output="output.html",local=False):
if fileread.comments:
filewrite.write("<li class=\"prazelink\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/comments/" + ficnostring + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/comments/" + ficnostring + "/index.html")
else:
filewrite.write("/fic/comments/" + ficnostring)
filewrite.write("\">comments</a></li>\n")
@ -170,12 +170,12 @@ def linkgen(ficno,output="output.html",local=False):
if fileread.locked:
filewrite.write("class=\"locked\" href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/")
else:
filewrite.write("/fic/secret/")
else:
if local:
filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/")
filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/")
else:
filewrite.write("href=\"/fic/files/")
filewrite.write(translationstring + ".html\">HTML</a></li>\n")
@ -185,12 +185,12 @@ def linkgen(ficno,output="output.html",local=False):
if fileread.locked:
filewrite.write("class=\"locked\" href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/")
else:
filewrite.write("/fic/secret/")
else:
if local:
filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/")
filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/")
else:
filewrite.write("href=\"/fic/files/")
filewrite.write(translationstring + ".pdf\">PDF</a></li>\n")
@ -200,12 +200,12 @@ def linkgen(ficno,output="output.html",local=False):
if fileread.locked:
filewrite.write("class=\"locked\" href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/")
else:
filewrite.write("/fic/secret/")
else:
if local:
filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/")
filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/")
else:
filewrite.write("href=\"/fic/files/")
filewrite.write(translationstring + ".epub\">EPUB</a></li>\n")
@ -222,7 +222,7 @@ def linkgen(ficno,output="output.html",local=False):
if any(item in fffandoms for item in fileread.fandom):
filewrite.write("<li class=\"prazelink\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/comments/" + translationstring + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/comments/" + translationstring + "/index.html")
else:
filewrite.write("/fic/comments/" + translationstring)
filewrite.write("\">comments</a></li>\n")
@ -231,7 +231,7 @@ def linkgen(ficno,output="output.html",local=False):
if timeelapsed.days < 730:
filewrite.write("<li class=\"prazelink\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/comments/" + translationstring + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/comments/" + translationstring + "/index.html")
else:
filewrite.write("/fic/comments/" + translationstring)
filewrite.write("\">comments</a></li>\n")
@ -240,7 +240,7 @@ def linkgen(ficno,output="output.html",local=False):
if transread.comments:
filewrite.write("<li class=\"prazelink\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/comments/" + translationstring + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/comments/" + translationstring + "/index.html")
else:
filewrite.write("/fic/comments/" + translationstring)
filewrite.write("\">comments</a></li>\n")
@ -290,7 +290,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
filewrite.write(" id=\"fic" + ficnostring + "\"")
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")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/single/" + ficnostring + "/index.html")
else:
filewrite.write("/fic/single/" + ficnostring)
filewrite.write("\">" + ficnostring + "</a>")
@ -298,7 +298,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
if translationstring:
filewrite.write("/<a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/single/" + translationstring + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/single/" + translationstring + "/index.html")
else:
filewrite.write("/fic/single/" + translationstring)
filewrite.write("\">" + translationstring + "</a>")

@ -46,7 +46,7 @@ def singlepage(ficno,directory,local=False):
filewrite = open(output, "a")
filewrite.write("<iframe src=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/files/" + ficnostring + ".html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/files/" + ficnostring + ".html")
else:
filewrite.write("/fic/files/" + ficnostring + ".html")
filewrite.write("\"></iframe>\n<div class=\"fic\">\n")

@ -165,7 +165,7 @@ def ficsum(ficcount,year,month=0,showfandom=True,local=False):
ficstring = ""
ficstring += "<a href=\""
if local:
ficstring += "/home/mdd/Documents/drive/proj/fic-archive/build/single/"
ficstring += "/home/mdd/Documents/proj/fic-archive/build/single/"
else:
ficstring += "/fic/single/"
try:
@ -737,7 +737,7 @@ def yeargen(local=False):
prevyear = yearlist[listposition - 1]
filewrite.write("<span style=\"float:left;\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/stats/" + str(prevyear) + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/stats/" + str(prevyear) + "/index.html")
else:
filewrite.write("/fic/stats/" + str(prevyear))
filewrite.write("\"" + str(prevyear) + "</a></span>")
@ -747,7 +747,7 @@ def yeargen(local=False):
nextyear = yearlist[listposition + 1]
filewrite.write("<span style=\"float:right;\"><a href=\"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/stats/" + str(nextyear) + "/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/stats/" + str(nextyear) + "/index.html")
else:
filewrite.write("/fic/stats/" + str(nextyear))
filewrite.write("\">" + str(nextyear) + " »</a></span>")

@ -9,9 +9,9 @@ def verifygen(local=False):
# write header
headerfooter.headerwrite("build/verify/index.html","Trés fic archive","Warning","",True,local)
filewrite = open("build/verify/index.html", "a")
filewrite.write("<p><strong>Please note before proceeding:</strong></p>\n<p>Some of my fanfiction is NSFW (ranging from slightly obscene language to explicit sex scenes), some is RPF, and some of it contains mature or potentially objectionable themes (death, suicide, mental illness, incest …). Ratings and warnings are given accordingly, <strong>dont like dont read</strong>. If you happen to be under 18, kindly gtfo and <em>read some real literature instead</em>. Honestly, it will be much more edifying.</p>\n<label for=\"verifyage-checkbox\">Please tick to confirm you have read this warning and are an adult:</label>\n<input type=\"checkbox\" id=\"verifyage-checkbox\">\n<button id=\"verifyage-button\">Let me in!</button>\n</div>\n</div>\n<script>\nvar verifyageButton = document.getElementById(\"verifyage-button\"); var verifyageCheckbox = document.getElementById(\"verifyage-checkbox\"); verifyageButton.addEventListener(\"click\", () => {if (verifyageCheckbox.checked) {localStorage.setItem(\"ageVerified\", \"\"); if (window.location = window.location.search.startsWith(\"?returnto=\")) {window.location = window.location.search.substring(\"?returnto=\".length);} else {window.location = \"")
filewrite.write("<p><strong>Please note before proceeding:</strong></p>\n<p>Some of my fanfiction is NSFW (ranging from slightly obscene language to explicit sex scenes), some is RPF, and some of it contains mature or potentially objectionable themes (death, suicide, mental illness, incest …). Ratings and warnings are given accordingly, <strong>dont like dont read</strong>. If you consider yourself to be a minor, kindly gtfo and <em>read some real literature instead</em>. Honestly, it will be much more edifying.</p>\n<label for=\"verifyage-checkbox\">Please tick to confirm you have read this warning and are sufficiently mature to access this content:</label>\n<input type=\"checkbox\" id=\"verifyage-checkbox\">\n<button id=\"verifyage-button\">Let me in!</button>\n<div align=\"center\">\n<script>\ndocument.write('<script src=\"https://ficring.neocities.org/ring.js\"><\/script>');\n</script>\n</div>\n</div>\n</div>\n<script>\nvar verifyageButton = document.getElementById(\"verifyage-button\"); var verifyageCheckbox = document.getElementById(\"verifyage-checkbox\"); verifyageButton.addEventListener(\"click\", () => {if (verifyageCheckbox.checked) {localStorage.setItem(\"ageVerified\", \"\"); if (window.location = window.location.search.startsWith(\"?returnto=\")) {window.location = window.location.search.substring(\"?returnto=\".length);} else {window.location = \"")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/index.html")
filewrite.write("/home/mdd/Documents/proj/fic-archive/build/index.html")
else:
filewrite.write("/fic")
filewrite.write("\";}} else {alert(\"You must agree before proceeding.\");}});\n</script>\n</body>\n</html>")

Loading…
Cancel
Save