-
Notifications
You must be signed in to change notification settings - Fork 0
/
pelicanconf.py
106 lines (83 loc) · 2.21 KB
/
pelicanconf.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
#!/usr/bin/env python3
import functools
AUTHOR = "Giampaolo Rodola"
SITENAME = "Giampaolo Rodola"
SITESUBTITLE = "Python enthusiast, core developer, psutil author"
SITEURL = "http://127.0.0.1:8000"
TWITTER_USERNAME = "grodola"
THEME = "theme"
PATH = "content"
TIMEZONE = "Europe/Rome"
DEFAULT_LANG = "en"
GOOGLE_ANALYTICS = "UA-164357405-2"
DISQUS_SITENAME = "gmpy-dev"
# --- atom / rss feeds (http://127.0.0.1:8000/feeds)
# Planet python uses:
# https://gmpy.dev/feeds/atom.tag.python.xml
FEED_ALL_ATOM = "feeds/atom.all.xml"
FEED_ALL_RSS = "feeds/rss.all.xml"
TAG_FEED_ATOM = "feeds/atom.tag.{slug}.xml"
TAG_FEED_RSS = "feeds/rss.tag.{slug}.xml"
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
CATEGORY_FEED_ATOM = None
CATEGORY_FEED_RSS = None
TRANSLATION_FEED_ATOM = None
TRANSLATION_FEED_RSS = None
# --- social widget
SOCIAL = (
("github", "https://github.com/giampaolo"),
("linkedin", "https://www.linkedin.com/in/grodola/"),
("twitter", "https://twitter.com/grodola"),
)
# --- menu
DISPLAY_CATEGORIES_ON_MENU = False
DISPLAY_PAGES_ON_MENU = False
MENUITEMS = (
("Blog", "/"),
("Archives", "/archives"),
("Donate", "/donate"),
("About", "/about"),
)
# --- blog
ARTICLE_PATHS = ["blog"]
ARTICLE_URL = "blog/{date:%Y}/{slug}"
ARTICLE_SAVE_AS = "blog/{date:%Y}/{slug}.html"
DEFAULT_PAGINATION = 5
# --- pages
PAGE_PATHS = [""]
PAGE_URL = "{slug}"
PAGE_SAVE_AS = "{slug}.html"
# Do not generate /author/* HTML files.
AUTHOR_SAVE_AS = ""
# Do not generate /categories.html
CATEGORIES_SAVE_AS = ""
# --- tags
TAG_SAVE_AS = "tags/{slug}.html"
TAG_URL = "tags/{slug}"
# --- plugins
PLUGIN_PATHS = ["plugins"]
PLUGINS = ["headerid"]
# ---paths
# static paths will be copied without parsing their contents
STATIC_PATHS = [
"static",
"images",
"extra",
"extra/CNAME",
]
EXTRA_PATH_METADATA = {
"extra/favicon.ico": {"path": "favicon.ico"},
"extra/htaccess": {"path": ".htaccess"},
"extra/CNAME": {"path": "CNAME"},
}
DIRECT_TEMPLATES = ["index", "tags", "categories", "archives"]
# --- others
JINJA_FILTERS = {
"sort_by_tags": functools.partial(
sorted,
key=lambda tags: (len(tags[1]), -ord(tags[0].name[0])),
reverse=True,
)
}
DEFAULT_DATE_FORMAT = "%d %b %Y"