forked from kalgynirae/lumeh.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
websleydalerc.py
107 lines (100 loc) · 2.98 KB
/
websleydalerc.py
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
from functools import partial
from websleydale import (
Author,
Site,
build,
dir,
fake,
file,
jinja,
markdown,
root,
sass,
)
def index(path):
return {
f"{path}/.header.html": jinja(
fake({"title": str(path), "hide_title": True}), template="header.html"
),
f"{path}/.footer.html": jinja(fake(), template="footer.html"),
}
def page(source):
return jinja(markdown(source), template="page.html")
site = Site(
known_authors={
Author(
display_name="kalgynirae",
email="[email protected]",
url="https://github.com/kalgynirae/",
)
},
name="lumeh.org",
repo_name="kalgynirae/lumeh.org",
repo_url="https://github.com/kalgynirae/lumeh.org",
tree={
"css/lumeh.css": sass(root / "css/lumeh.sass"),
"docs": dir(root / "docs"),
"font": dir(root / "font"),
"guess": dir(root / "guess"),
"image": dir(root / "image"),
"js": dir(root / "js"),
"media": dir(root / "media"),
"redirects.conf": file(root / "redirects.conf"),
"robots.txt": file(root / "robots.txt"),
**{
(
f"{path.relative_to(root/'pages').with_suffix('.html')}"
if path.name == "index.md"
else f"{path.relative_to(root/'pages').with_suffix('')}/"
): page(path)
for path in root.glob("pages/**/*.md")
},
**{
f"projects/{path.name}/": page(path / "README.md")
for path in root.glob("projects/*")
if not path.name == "recipes"
},
**{
f"recipes/{name.replace('_', '-')}/": page(
root / f"projects/recipes/{name}.md"
)
for name in [
"almond_salad_dressing",
"apple_cider",
"apple_crisp",
"asparagus_mushroom_soup",
"banana_bread",
"bettys_chili",
"calico_beans",
"chana_masala",
"chana_masala_with_spice_kit",
"chancakes",
"chicken_curry",
"chicken_curry_v2",
"chili",
"chonklate_chip_cookies",
"christmas_anything",
"cookies",
"cottage_pie",
"creme_brulee_cheesecake",
"curry_chicken_pot_pie",
"dal",
"first_watch_seasoning",
"green_bean_bundles",
"lemonade",
"little_white_ball_cookies",
"mac_and_cheese",
"popovers",
"pumpkin_bread",
"quiche",
"shortbread_cookies",
"sweet_potato_casserole",
"thai_chicken_curry",
]
},
**index("projects"),
**index("recipes"),
**index("tools"),
},
)
build(site, dest="out")