Repository navigation
Expand file tree
/
Copy pathapp.py
More file actions
63 lines (50 loc) · 1.55 KB
/
Copy pathapp.py
File metadata and controls
63 lines (50 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from pathlib import Path
from typing import Callable, Any
from render_engine import BasePageParser, Blog, Page, Site
from render_engine_markdown import MarkdownPageParser
from re_plugin_pack import LatestEntries
MD_EXTRAS: list[str] = [
"link-shortrefs",
]
app = Site()
app.output_path = "output"
app.static_paths = list(map(Path, ("styles", "img", "scripts")))
app.site_vars.update(
{
"SITE_TITLE": "Render Engine",
"SITE_URL": "https://render-engine.org",
"bottom_nav": {
"Home": "/index.html",
"News": "/news",
},
}
)
@app.page
class Index(Page):
template = "index.html"
content_path = "content/index.md"
Parser: type[BasePageParser] = MarkdownPageParser
parser_extras: dict[str, list[str]] = {"markdown_extras": MD_EXTRAS}
plugins: list[tuple[Callable, dict[str, Any]] | Callable] = [
(
LatestEntries,
{
"news": -1,
},
)
]
@app.page
class About(Page):
template = "page.html"
content_path = "content/about.md"
Parser: type[BasePageParser] = MarkdownPageParser
parser_extras: dict[str, list[str]] = {"markdown_extras": MD_EXTRAS}
@app.collection
class News(Blog):
content_path: str = "content/news" # path to content files
routes: list[str] = ["news"] # route to collection page
Parser: type[BasePageParser] = MarkdownPageParser
template: str = "news.html"
parser_extras: dict[str, list[str]] = {"markdown_extras": MD_EXTRAS}
if __name__ == "__main__":
app.render()