-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugins.py
42 lines (35 loc) · 928 Bytes
/
plugins.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
import typing
from datetime import datetime
from stencil import SafeStr
from gilbert import Site
from gilbert.content import Templated, Content
class BlogPost(Templated, Content):
title: str
authors: list
posted: datetime
modified: typing.Union[None, datetime]
category: str
tags: list
template: str = "blog/post_detail.html"
summary: str
draft: bool
class Page(Templated, Content):
in_menu: bool = True
call_to_action_text: str
class TeamMember(Templated, Content):
name: str
role: str
location: str
template: str="team/team_detail.html"
summary: str
img: str
personalURL: typing.Union[None, str]
socialURL: typing.Union[None, dict]
class Service(Templated, Content):
name: str
template: str="service/service_detail.html"
summary: str
@Site.register_context_provider
def global_context(ctx):
ctx['safe'] = SafeStr
return ctx