Show HN: Neostatic, a tiny site/blog generator for neocities

scaramanga1 pts0 comments

GitHub - giannitedesco/neostatic: A small neocities static blog generator · GitHub

/" data-turbo-transient="true" />

Skip to content

Search/

Sign in<br>Sign upAppearance settings

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

giannitedesco

neostatic

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Latest commit

History<br>1 Commit<br>1 Commit

Folders and files<br>NameNameLast commit message<br>Last commit date<br>neostatic

neostatic

.gitignore

.gitignore

COPYING

COPYING

README.md

README.md

pre-commit.sh

pre-commit.sh

pyproject.toml

pyproject.toml

View all files

Repository files navigation

neostatic

A small static site generator for blogs, written in Python.

TOML config → Markdown posts (Markdown-metadata frontmatter) → Jinja2<br>templates → static output directory → upload.

Kind of a love-letter to neocities.org.

Why this exists

Most static site generators (Hugo, Zola, Jekyll) are general-purpose<br>templating systems that happen to be good at blogs. neostatic does the<br>opposite: it only does one shape of site (a blog, plus static passthrough<br>content), and stays small enough to read end to end in one sitting.

A few things that follow from that:

Upload is part of the tool, not bolted on afterward. neostatic<br>renders to a local site/ directory and then pushes it straight to<br>Neocities in the same invocation (--offline skips the upload step).<br>Most generators render only and leave publishing to a separate script.

It refuses to destroy a source tree. If the output directory itself<br>contains .git or the site's own neostatic.toml, neostatic treats<br>that as a sign it's pointed at the wrong place and stops rather than<br>deleting it.

TOML for config, Markdown metadata for posts. Site config is TOML;<br>post frontmatter uses Python-Markdown's meta extension rather<br>than a second data format embedded in the post.

Quick start

[-v] [--offline] [--dry-run]">python -m neostatic site-dir> [-v] [--offline] [--dry-run]

A site directory looks like:

site-dir/<br>neostatic.toml<br>static/ # copied through as-is (allow-listed extensions)<br>templates/<br>index.html<br>blogpost.html # default post template; override per-post<br>posts/<br>2024-01-01-hello.md

Config (neostatic.toml)

[blog]<br>[blog.paths]<br>static = "static"<br>templates = "templates"<br>posts = "posts"<br>site = "site"<br>[blog.meta]<br>title = "example"<br>strapline = "a blog"

[neocities]<br>proxy = "socks5://127.0.0.1:9150" # optional, e.g. for publishing over Tor<br>user = "..."<br>password = "path/to/password-file" # contents read at load time, not inline<br>api_key = "path/to/api-key-file" # preferred over user/password if present

[blog.paths] and [neocities] are both optional; paths default to the<br>names shown above, and Neocities upload just isn't available without that<br>section. If api_key isn't set yet but a path is given, neostatic will<br>fetch a key on first run (using user/password) and write it there.

Posts

Markdown-extension frontmatter, no delimiters — a block of key: value<br>lines followed by a blank line:

title: Hello<br>date: 2024-01-01T12:00:00+00:00<br>published: true<br>summary: An optional one-line summary.<br>slug: hello<br>template: blogpost

Body in Markdown.

Only title and date are required. published defaults to false;<br>slug defaults to a slugified title; template defaults to<br>blogpost. Only published: true posts get a generated page and appear<br>in the index; everything else is loaded but skipped at render time.

About<br>A small neocities static blog generator<br>Resources<br>Readme<br>GPL-3.0 license<br>Activity<br>Stars<br>0 stars<br>Watchers<br>0 watching<br>Forks<br>0 forks<br>Report repository

Releases

Packages

Contributors

Languages

You can’t perform that action at this time.

neostatic site blog static neocities toml

Related Articles