News for hackers. Stuff that matters.
Re:Static Sites with Python, uv, Caddy, and Docker by knlb on Saturday August 23, 2025 @07:28PM (#44999933)
My current personal site (https://knlb.dev) is built with a single 500 line python file that starts with

  #!/usr/bin/env -S uv run --script
  # -*- mode: python -*-
  #
  # /// script
  # requires-python = ">=3.12"
  # dependencies = [
  #    "pyyaml", "flask", "markdown-it-py",
  #    "linkify-it-py", "mdit-py-plugins"
  # ]
  # ///
The HTML templates & CSS are baked into the file which is why it's so long. flask so that I can have a live view locally while writing new notes.

uv's easy dependency definition really made it much easier to manage these. My previous site was org exported to html and took much more effort.

(With the conceit that the website is a "notebook" I call this file "bind").

Re:Static Sites with Python, uv, Caddy, and Docker by justusthane on Saturday August 23, 2025 @10:07PM (#45000696)
Do you have the whole thing available? I love SSGs, especially personal ones.
Re:Static Sites with Python, uv, Caddy, and Docker by knlb on Sunday August 24, 2025 @11:15AM (#45004858)
Not the latest one just yet, I still want to play with it a lot more / bake in some more features -- but it's also terribly simple and doesn't do much at the moment.

The org mode one is at https://explog.in/config.html.