feat: initial implementation

This commit is contained in:
randogoth 2026-09-26 12:45:51 +03:00
commit c3cb1d7046
19 changed files with 1296 additions and 0 deletions

28
tests/conftest.py Normal file
View file

@ -0,0 +1,28 @@
from __future__ import annotations
from pathlib import Path
import pytest
from smolweb.site import Site
@pytest.fixture
def site(tmp_path: Path) -> Site:
(tmp_path / "index.md").write_text("# Home\n\nHello.\n", encoding="utf-8")
(tmp_path / "about.md").write_text("---\ntitle: About\n---\n# About\n\nBody.\n", encoding="utf-8")
(tmp_path / "img.png").write_bytes(b"\x89PNG\r\n\x1a\nfake")
sub = tmp_path / "dir"
sub.mkdir()
(sub / "index.md").write_text("# Nested\n\nNested body.\n", encoding="utf-8")
(tmp_path / ".secret.md").write_text("# Hidden\n", encoding="utf-8")
(tmp_path / "trail.md").write_text(
"---\ntitle: Trail\ndeck_per_card: true\n---\n"
"Intro line.\n\n"
"{.card Weather}\n"
"Cold and clear. Permit fee: $5.\n\n"
"{.card Status}\n"
"- North: open\n",
encoding="utf-8",
)
return Site(tmp_path)