Long-enough articles (3+ in-body h1/h2) get slug ids (python-slugify,
mirroring the editor's slugify.js) and the heading text becomes a
self-link (a.anchor) for clean link copying; {#id} always wins,
duplicates get -2/-3 suffixes, h3+ never. The implicit page title is
now injected as '# {title}' into the markdown (render(title=...)), so
it takes the same first-h1 path as an explicit one: no id, href=""
self-link scrolling to top, not counted toward the threshold. The
.body wrapper is gone — segments are direct article children — and the
editor preview swaps the whole article in one go. pagerite.js tracks
the reading position in the location hash (last tagged heading above
the viewport middle; cleared at the top, never on unscrollable pages)
and scrolls to anchors after fetch-navigation.
58 lines
1.3 KiB
TOML
58 lines
1.3 KiB
TOML
[build-system]
|
|
requires = [
|
|
"hatchling>=1.25.0",
|
|
"hatch-vcs>=0.4.0",
|
|
]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "pagerite"
|
|
dynamic = ["version"]
|
|
description = "A modern website and Content Management System."
|
|
authors = [
|
|
{ name = "Leo Vasanko" },
|
|
]
|
|
keywords = ["cms", "blog", "fastapi", "markdown"]
|
|
readme = "README.md"
|
|
requires-python = ">=3.14"
|
|
dependencies = [
|
|
"blake3>=1.0.9",
|
|
"fastapi-vue>=1.3.1",
|
|
"fastapi[standard]>=0.141.1",
|
|
"html5tagger>=2.0.0",
|
|
"httpx>=0.28.1",
|
|
"kanta>=0.8.1",
|
|
"markdown-it-py>=4.2.0",
|
|
"maxminddb>=3.1.1",
|
|
"mdit-py-plugins>=0.6.1",
|
|
"pygments>=2.20.0",
|
|
"python-slugify>=8.0.4",
|
|
"ua-parser>=1.0.2",
|
|
"zstandard>=0.25.0",
|
|
]
|
|
|
|
[project.scripts]
|
|
pagerite = "pagerite.__main__:main"
|
|
|
|
[project.urls]
|
|
Repository = "https://git.zi.fi/LeoVasanko/pagerite"
|
|
|
|
[dependency-groups]
|
|
dev = []
|
|
|
|
[tool.hatch.version]
|
|
source = "vcs"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["pagerite"]
|
|
|
|
[tool.hatch.build]
|
|
# `only-packages` drops directories without an __init__.py, so the theme
|
|
# files and seed image assets must be force-included as artifacts (like
|
|
# the frontend build).
|
|
artifacts = ["pagerite/frontend-build", "pagerite/themes", "pagerite/seed-assets"]
|
|
only-packages = true
|
|
|
|
[tool.hatch.build.targets.sdist.hooks.custom]
|
|
path = "scripts/fastapi-vue/buildhook.py"
|