code for my very abstruse python-based static site generator – eta, I mean *one* of my python-based SSGs because I've written like five of them???
Find a file
2025-07-26 20:06:54 +01:00
.gitignore Replace old pages with new ones 2025-07-19 23:32:29 +01:00
archivesearch.py Start redesign 2025-07-12 19:22:32 +01:00
build.sh Add stats page 2025-07-20 19:26:31 +01:00
COPYING Add files 2023-06-10 00:28:02 +01:00
fandomsedit.py - Read in fandom name substitutions from a central location 2025-07-21 20:10:52 +01:00
feed.py Replace old pages with new ones 2025-07-19 23:32:29 +01:00
generate.py Add single pages for linking to 2023-09-09 12:08:43 +01:00
mention.py Update readme 2025-07-21 20:46:06 +01:00
new.py Fix nesting 2025-07-26 20:06:54 +01:00
originals-template.py - Read in fandom name substitutions from a central location 2025-07-21 20:10:52 +01:00
README.org Update readme 2025-07-21 20:46:06 +01:00
sortfics.sh Replace old pages with new ones 2025-07-19 23:32:29 +01:00
stats.py - Read in fandom name substitutions from a central location 2025-07-21 20:10:52 +01:00
translations-template.py - Read in fandom name substitutions from a central location 2025-07-21 20:10:52 +01:00

Code for my personal fic archive

Significantly redesigned in July 2025.

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.

Fic metadata lives in files/originalsmeta/ following the template, translation metadata in files/translationsmeta/; the filename for each is a unique 3-digit number. Fic files with the corresponding filenames live in files/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 basic auth as specified in my site’s nginx configuration. In the current setup the comments are sent to a private GoToSocial account, so do modify the POST request in the comments pages if you don’t want your own test comments being sent to me, haha.

Requisites: rclone (just for uploading files to the server), Python 3, and the Python libraries bs4, datetime, importlib, os, random, re, requests (out of these bs4 and requests are probably the only ones that require explicit installation).

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
  • HTML, PDF and EPUB formats exist for most fics, but this can be adjusted for individual entries as needed
  • whether commenting is enabled on a particular fic depends on a couple of factors