code for my very abstruse python-based static site generator
Find a file
2024-04-06 19:03:38 +01:00
build Change ratings terminology, better emoji support 2023-11-20 20:21:51 +00:00
originalsmeta Add links to singles pages and to fedi posts where applicable 2024-04-06 19:03:38 +01:00
texts Add files 2023-06-10 00:28:02 +01:00
translationsmeta Add files 2023-06-10 00:28:02 +01:00
.gitignore Add single pages for linking to 2023-09-09 12:08:43 +01:00
build.sh Link to singles from stats pages 2023-09-20 23:28:35 +01:00
characters.py Sort fics properly 2023-11-20 21:26:41 +00:00
commentpage.py Update email address 2023-12-15 09:24:48 +00:00
COPYING Add files 2023-06-10 00:28:02 +01:00
events.py Sort fics properly 2023-11-20 21:26:41 +00:00
fandoms.py Sort fics properly 2023-11-20 21:26:41 +00:00
feed.py Replace slashes with × in ship names like any good old-school weeb 2024-03-29 11:56:20 +00:00
generate.py Add single pages for linking to 2023-09-09 12:08:43 +01:00
headerfooter.py Add theme colour 2024-02-17 21:56:39 +00:00
indexgen.py Add link to the code from index page, update readme 2024-01-14 11:56:26 +00:00
makeheader.py Add links to singles pages and to fedi posts where applicable 2024-04-06 19:03:38 +01:00
masterlist.py Sort fics properly 2023-11-20 21:26:41 +00:00
README.org Add links to singles pages and to fedi posts where applicable 2024-04-06 19:03:38 +01:00
ships.py Replace slashes with × in ship names like any good old-school weeb 2024-03-29 11:56:20 +00:00
single.py Generate single pages for locked fics, link to single pages from RSS feed, use local CSS file in local build 2023-09-09 21:11:12 +01:00
sortfics.sh Makes more sense to overwrite output files 2023-09-02 08:14:13 +01:00
statsgen.py Replace slashes with × in ship names like any good old-school weeb 2024-03-29 11:56:20 +00:00
verifygen.py Add age verification gate and some noscript fallbacks 2023-06-10 09:47:13 +01:00
wordcount.py Add page for FF fics by wordcount, deal with spoilers in RSS feed, change wording in a few places 2023-07-07 21:01:13 +01:00

Code for my personal fic archive

Preliminaries

This is very much set up for my own use, but the code is public so others can see how this works and build similar things for themselves, if they like.

build.sh generates files in the build directory and uploads them to the remote using rclone. To build locally for testing, run python3 generate.py local, which generates links that point straight to index.html instead of the containing directory.

This is for my personal use and definitely wont work as is for other people, but feel free to dig around in the files. I am an amateur and I almost certainly dont follow best practices in any respect.

Fic metadata lives in originalsmeta/ following the template, translation metadata in translationsmeta/; the filename for each is a unique 3-digit number. Fic files with the corresponding filenames live in texts (HTML, PDF, and EPUB are recognised in the script, which then moves them into build/files/ or build/secret/ according to metadata).

On the server my secret/ folder is protected using .htpasswd. In the current setup the comments are sent to my private Discord server using webhooks, so do modify the POST request in the comments pages if you dont want your own test comments being sent to my server, haha.

Requisites: rclone (just for uploading files to the server), Python 3.

My use case

  • most of my current fandoms are numbered parts of a bigger franchise
  • some of my fics have both English and French versions
  • I have a lot of juvenilia that I want to place behind a veneer of protection
  • 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 [3/6]

  • redirect to a consent page using local storage (h/t Fandom Coders)
  • pages for times and locations in FF fandoms
  • 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.) in progress
  • drabble wall
  • link to singles pages from headers? on the number?