Skip to content

keithly/personal-site

Repository files navigation

personal-site

A static site generator based on makesite, with many changes.

Setup

This project has dependencies other than Python itself, so create a venv for it. Use python 3.10 or newer. A .tool-versions file exists for managing the Python version with asdf.

python -m venv venv

Dependencies are listed in the pyproject.toml file and managed with pip-tools.

To install pip-tools and all dependencies, run ./script/local-setup

There's also a github actions workflow, which runs tests when the code is pushed to github. It uses script/gh-dependencies to install dependencies from the requirements file generated by local-setup.

The others in script/ can be run both locally and by the github actions workflow.

Usage

./script/server runs all the tests, generates the site into _site, and serves it on http://localhost:8000

There's no hot reload mechanism built in, but something like entr can be used to achieve this.

Differences from the makesite project

A non-exhaustive list:

  • make is replaced with bash scripts and a github workflow.
  • No attempt is made to remain compatible with pure POSIX or with unsupported Python versions.
  • Markdown is the assumed format for all posts, and markdown-it-py replaces the deprecated commonmark. This also enables smart quotes and other typographic niceties.
  • A post summary contains the first paragraph of the post, and it will render markdown and html.
  • Tests use pytest and have been rewritten for it as needed.
  • A working directory path is configured, primarily so tests can always use a proper tmp directory and not touch the actual site output when run.
  • The home page is the blog index page.
  • The page.html template has a more modern and extensive set of <head> elements, including favicons.
  • It almost goes without saying, but the design of the site is different. CSS is based on the original file and simple.css, but it has diverged greatly.

License

This is free and open source software. You can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of it, under the terms of the MIT License.

This software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, express or implied. See the MIT License for details.