Skip to content

HenrySwanson/math-mondays

Repository files navigation

Build and Deploy Site

Sometimes I like to write about math.

Project Structure

This is mostly a normal Pelican site, but I've got an unusual custom setup for assets.

Many of the images and JavaScript files on the website are created at build-time from a set of TypeScript source files. This is because I like the idea of being able to modify a set of assets all at the same time, in order to keep a consistent style. So far, it hasn't paid off much, but the more time I invest in it, the more I'll benefit (I hope).

Asset Pipeline

Pelican doesn't know about this at all. The output of this pipeline gets dumped into content/, where Pelican picks it up like it would normal asset files.

  • asset-generator/: Everything about the pipeline lives in here
    • dist/: Output of Typescript -> JavaScript compilation
    • src/: Source files for the assets.
      • Inside, we mimic the content directory as closely as possible (especially for code specific to exactly one article)
      • But there are also additional directories that contain shared libraries (e.g. for math)
    • static/: Assets that aren't programmatically generated
      • I'd like to merge this with src/
    • test/: Files for testing the library code
      • I'd also like to merge this with src/
    • web-bundles/: Output of JavaScript -> Webpack bundling
    • index.ts: Package entry point
      • To generate images, files are explicitly listed here
    • jest.config.js: Config for testing
    • package.json: Config for the package as a whole
    • tsconfig.json: Config for the TypeScript compilation stage
    • webpack.config.js: Config for the Webpack bundling stage
      • To generate a JS bundle, files are explicitly listed here

Pelican Site Generator

  • content/: This is the normal Pelican content directory
    • ./*.md: Contains the blogposts
      • Kind of want to shunt this into a specific folder
    • extra/: Contains static files that should sit in the root directory of the output
    • images/: Contains images, is output to output/images/
    • js/: Contains JavaScript, is output to output/js/
    • pages/: Contains webpages that are not articles
  • output/: This is where Pelican puts the website output
  • plugins/: Contains my Pelican plugins
    • (right now it's just a patched version of the "summary" plugin)
  • theme/: Contains styling info for the site
    • static/: Contains fonts and CSS
    • templates/: Contains the HTML templates for each kind of webpage
  • pelicanconf.py: Pelican settings for development
  • publishconfig.py: Pelican settings for production
  • tasks.py: Pelican CLI configuration (Makefile-ish)

Other Files

  • justfile: Configuration for Just, a tool that means I type fewer things
  • LICENSE: This is a license.
    • I am not sure how to encode this legally, but please interpret it as referring to the asset generator and the Pelican setup.
    • Please don't copy, sell, etc., the contents of the posts themselves.
    • But everything else in this repo is fair game.
  • Makefile: Generated by default; I don't use this
  • README.md: This file!
  • requirements.txt: The set of Python packages that need to be installed to run this site generator

Miscellaneous

Fonts are used under the SIL Open Font License, and were downloaded from: