code for my very abstruse python-based static site generator
Find a file
2025-01-01 22:01:04 +00:00
build Add CSS for contents navigator 2024-08-05 19:54:02 +01:00
.gitignore Store all user data in a folder 2024-08-06 19:37:17 +01:00
build.sh Change server 2024-07-28 21:19:24 +01:00
characters.py Store all user data in a folder 2024-08-06 19:37:17 +01:00
commentpage.py Set max length for comments 2024-11-22 13:40:05 +00:00
COPYING Add files 2023-06-10 00:28:02 +01:00
events.py Store all user data in a folder 2024-08-06 19:37:17 +01:00
fandoms.py Add CC licence to index page, add wordcounts to fandom list 2024-09-22 09:55:14 +01:00
feed.py Fix RSS feed error 2025-01-01 22:01:04 +00:00
generate.py Add single pages for linking to 2023-09-09 12:08:43 +01:00
headerfooter.py As before 2024-09-14 23:24:23 +01:00
indexgen.py No need to have JS that just prints JS now is there lads 2024-12-02 21:11:32 +00:00
makeheader.py Refine ficwip inclusion 2024-10-22 12:32:32 +01:00
masterlist.py Store all user data in a folder 2024-08-06 19:37:17 +01:00
originals-template.py Move template files to the main repo; adjust readme for folder structure changes; tweak some wording on the site 2024-08-16 19:59:59 +01:00
README.org Move template files to the main repo; adjust readme for folder structure changes; tweak some wording on the site 2024-08-16 19:59:59 +01:00
ships.py Store all user data in a folder 2024-08-06 19:37:17 +01:00
single.py Remove links to dead fedi posts, add header for improved fediverse discoverability 2024-09-14 23:14:57 +01:00
sortfics.sh Store all user data in a folder 2024-08-06 19:37:17 +01:00
statsgen.py Refine ficwip inclusion 2024-10-22 12:32:32 +01:00
translations-template.py Move template files to the main repo; adjust readme for folder structure changes; tweak some wording on the site 2024-08-16 19:59:59 +01:00
verifygen.py No need to have JS that just prints JS now is there lads 2024-12-02 21:11:32 +00:00
wordcount.py Store all user data in a folder 2024-08-06 19:37:17 +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 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 .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.

I am now storing fonts locally instead of loading them from Google, so the fonts (Hubballi, Merriweather, Noto Color Emoji) have to be downloaded and put in the /fonts/ directory (see google-webfonts-helper).

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?