-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathapp.py
More file actions
99 lines (80 loc) · 2.61 KB
/
app.py
File metadata and controls
99 lines (80 loc) · 2.61 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
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
import datetime
import json
import pathlib
from render_engine import Site, Page, Collection, Blog
from render_engine_markdown import MarkdownPageParser
navigation = [
{"text": "Home", "url": "/index.html", "fa": "fa fa-home fa-fw"},
{"text": "News", "url": "/blog/blog1.html", "fa": "fa fa-newspaper fa-fw"},
{"text": "About Us", "url": "/about.html", "fa": "fa fa-info-circle fa-fw"},
{"text": "BPD Events", "url": "/bpd-events", "fa": "fa fa-calendar fa-fw"},
{
"text": "Sponsored Events",
"url": "/sponsored-events.html",
"fa": "fa fa-handshake fa-fw",
},
{"text": "Community", "url": "/community.html", "fa": "fa fa-users fa-fw"},
{"text": "Discounts", "url": "/partnerships.html", "fa": "fa-regular fa-handshake"},
{
"text": "Support Us",
"url": "/support.html",
"fa": "fa-solid fa-money-check-dollar",
},
]
app = Site()
app.template_path = "_layouts"
app.static_paths.add("assets")
app.site_vars["locales"] = ["en"]
app.site_vars["navigation"] = navigation
app.site_vars["DATETIME_FORMAT"] = "%d %b %Y"
app.site_vars["year"] = str(datetime.date.today().year)
app.site_vars["SITE_AUTHORS"] = json.loads(
pathlib.Path("_data/authors.json").read_text()
)
@app.page
class Index(Page):
template = "index.html"
content_path = "index.html"
@app.page
class About(Page):
template = "about.html"
data = json.loads(pathlib.Path("_data/leadership.json").read_text())
@app.page
class Support(Page):
Parser = MarkdownPageParser
content_path = "support.md"
template = "support.html"
data = json.loads(pathlib.Path("_data/foundational_supporters.json").read_text())
@app.page
class SponsoredEvents(Page):
template = "sponsored-events.html"
slug = "sponsored-events"
data = json.loads(pathlib.Path("_data/sponsored_events.json").read_text())
template_vars = {}
@app.page
class Partnerships(Page):
template = "partnerships.html"
data = json.loads(pathlib.Path("_data/partnerships.json").read_text())
@app.collection
class Pages(Collection):
Parser = MarkdownPageParser
content_path = "pages"
template = "default.html"
@app.collection
class BPDEvents(Collection):
title = "BPD Events"
Parser = MarkdownPageParser
content_path = "events"
template = "default.html"
routes = ["./bpd-events"]
has_archive = True
archive_template = "event-list.html"
@app.collection
class Blog(Blog):
Parser = MarkdownPageParser
template = "post.html"
content_path = "_posts"
routes = ["./blog"]
has_archive = True
archive_template = "blog-list.html"
items_per_page = 10