A static site builder
Project description
lotek.run
A minimal static blog. Pandoc recommended; falls back to the markdown Python module if not available.
install
Install the package:
pip install .
Or install in development mode:
pip install -e .
Then use the lotek command:
Output goes to output/. Serve it with literally anything.
cli
For day-to-day post management and operations, use the lotek command:
lotek init Initialize a new site in the current directory
lotek build Build the site
lotek clean Remove build output
lotek serve [--port N] Serve output locally (default: 8000)
lotek deploy Build and deploy via rsync (reads .env)
lotek list List all posts (formatted table)
lotek add "Title" Create new post
lotek publish <slug> Mark a post as published
lotek unpublish <slug> Mark a post as unpublished
All files are human-editable and can be edited directly. It is recommended to preface your post files with a datecode, however it is not directly enforced. Note that the lotek add command will automatically add a datecode to the title, as well as providing the frontmatter template needed to be recognized by the lotek command.
It might seem weird that the only content editing command lotek exposes is "add". But there's no need for any other tools, because we refuse to enforce their need. With no dependencies come no obligations:
Need to delete a file? Use rm. Need to search? Use grep -r. Want a UI? Use an IDE like Sublime Text or VS Code. Use Obsidian. Don't like any of those options? Roll your own. The pieces are all here and exposed in plain view.
structure
content/posts/ markdown source files (YYYY-MM-DD-slug.md)
content/pages/ static pages (about.md, now.md, etc.)
templates/ html/xml templates
static/ css and any other static assets
output/ generated site (gitignored)
frontmatter
Posts and pages share the same frontmatter schema:
---
title: Post Title
date: YYYY-MM-DD
tags: tag1, tag2
publish: true
---
Set publish: false to suppress a file from the build without deleting it. lotek publish and lotek unpublish manage this field for posts.
pages
Any .md file in content/pages/ is built as a standalone page at /<slug>.html. Drop a file, wire up a nav link if you want it linked, done.
content/pages/about.md → /about.html
content/pages/now.md → /now.html
publish: false in frontmatter suppresses the build, same as posts.
404
output/404.html is generated on every build with full site chrome. Point your server at it:
- Apache:
ErrorDocument 404 /404.html - nginx:
error_page 404 /404.html
config
Site settings live in site-config.toml:
[site.features]
robotstxt = true # robots.txt + sitemap generation
rss = true # RSS feed generation
skip_future = true # exclude posts with dates > today
[site.rss]
limit = 10
timezone = "America/Los_Angeles"
[site.site]
title = "lotek.run"
url = "https://lotek.run"
description = "dispatches from the margins"
[[site.nav]]
label = "index"
href = "/"
[[site.nav]]
label = "about"
href = "/about.html"
Nav links are ordered and fully configurable. Add, remove, or reorder [[site.nav]] blocks to change what appears in the header. If no nav is configured, the defaults (index, about, rss) are used.
deploy
Set these in .env (see .env.example):
DEPLOY_USER=user
DEPLOY_HOST=example.com
DEPLOY_PATH=/var/www/html
Then run lotek deploy.
automation
I've set up automation via gitea runners personally, but that's out of scope of this project directly. I recommend figuring it out on your own but if I get requests for tutorials I'll probably write about it.
philosophy
No npm. No webpack. No framework. No build chain with a thousand dependencies ready to be poisoned upstream at any goddamn minute. Pandoc converts markdown to HTML. A Python script assembles pages from templates. The CSS is a flat file. Nothing requires Node.js. TA DA.
requirements
Python 3.9+. Pandoc recommended; falls back to the markdown package if not found.
If pandoc is not installed, install the fallback:
pip install markdown
getting started
mkdir mysite && cd mysite
lotek init
# edit site-config.toml with your title/url
lotek build
lotek serve
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lotek-0.4.0.tar.gz.
File metadata
- Download URL: lotek-0.4.0.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52a2b5321c28ae2f69913e39c950e474c3f1379db9c61e805d7be5602344a71d
|
|
| MD5 |
0c7a2611b4ab527d29120191b700ecc9
|
|
| BLAKE2b-256 |
5e56e5e470bbdb7fd9ccf64f4e27672d176da73b4a37e4f89d47217717249dfa
|
File details
Details for the file lotek-0.4.0-py3-none-any.whl.
File metadata
- Download URL: lotek-0.4.0-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdbc337a8bb36dc96fd15cef515277168ebbf0386dbe863e5b0a9d64f0e0e65e
|
|
| MD5 |
e39506f78e8eb83ea3d88155b7c80e1f
|
|
| BLAKE2b-256 |
bb71788b1d3b0b4fe3ae055f7934c782fa633694cc59b8e1ff054b8aac5419a9
|