-
Notifications
You must be signed in to change notification settings - Fork 0
/
pelicanconf.py
98 lines (71 loc) · 2.12 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
import copy
import os
from datetime import datetime
from itertools import groupby
from typing import Any
from pelican.utils import DateFormatter
from plugins import localdata
AUTHOR = "Maxime Le Conte des Floris"
SITENAME = "Films"
SITEURL = "https://films.mlcdf.fr"
PATH = "content"
TIMEZONE = "Europe/Rome"
DEFAULT_LANG = "fr"
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
DEFAULT_PAGINATION = False
# Uncomment following line if you want document-relative URLs when developing
RELATIVE_URLS = True
THEME = "theme"
THEME_STATIC_DIR = "theme"
PAGE_SAVE_AS = "{slug}/index.html"
PAGE_URL = "{slug}"
INDEX_SAVE_AS = "index.html"
STATIC_PATHS = ["extra", "images"]
EXTRA_PATH_METADATA = {
"extra/humans.txt": {"path": "humans.txt"},
}
MARKDOWN = {
"extension_configs": {
"markdown.extensions.codehilite": {"css_class": "highlight"},
"markdown.extensions.extra": {},
"markdown.extensions.meta": {},
"markdown.extensions.toc": {
"permalink": "#",
"permalink_title": "Lien permanent",
"baselevel": 2,
},
},
"extensions": [],
"output_format": "html5",
}
JINJA_ENVIRONMENT = {"extensions": ["jinja2.ext.loopcontrols"]}
JINJA_GLOBALS = {
"now": datetime.now,
"strftime": DateFormatter,
}
PLUGINS_PATH = ["./plugins"]
PLUGINS = [localdata]
def aria_hidden(txt: str) -> str:
return (
txt.replace("🗒", "<span aria-hidden='true'>🗒</span>")
.replace("📽️", "<span aria-hidden='true'>📽️</span>")
.replace("💗", "<span aria-hidden='true'>💗</span>")
)
def groupby_year(value):
def key(v):
return v["done_date"].year
return groupby(sorted(value, key=key, reverse=True), key)
JINJA_FILTERS = {
"aria_hidden": aria_hidden,
"groupby_year": groupby_year
}
TEMPLATE_PAGES = {
os.path.join(os.getcwd(), "theme/templates/love.html"): "love/index.html",
os.path.join(os.getcwd(), "theme/templates/wish.html"): "wish/index.html",
}
DATA_PATH = "data"