feat: initial implementation
This commit is contained in:
commit
c3cb1d7046
19 changed files with 1296 additions and 0 deletions
28
tests/conftest.py
Normal file
28
tests/conftest.py
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue