-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpelicanconf.py
More file actions
171 lines (152 loc) · 5.04 KB
/
pelicanconf.py
File metadata and controls
171 lines (152 loc) · 5.04 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/usr/bin/env python
import os
import sys
sys.path.append(".")
from integrantes import INTEGRANTES
AUTHOR = "Python Chile"
SITENAME = "Comunidad Chilena de Python"
SITESUBTITLE = "Lugar de encuentro de todas las personas entusiastas de Python a lo largo de Chile"
DESCRIPTION = (
"Nuestro objetivo es ser el lugar de encuentro de todos los entusiastas de Python "
"a lo largo del país, fortaleciendo a los miembros de la comunidad para generar un impacto "
"positivo en el desarrollo de Python a nivel nacional y mundial."
)
SITEURL = ""
PATH = "content"
TIMEZONE = "America/Santiago"
DEFAULT_LANG = "es"
THEME = os.path.join(os.path.dirname(__file__), "pycltheme")
# 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
DATE_FORMATS = { "es": "%d-%m-%Y"}
MENUELEMENTS = {
"home": {"title": "Home", "url": "index.html", "children": None},
"blog": {"title": "Blog", "url": "archives.html", "children": None},
"coc": {
"title": "Código de Conducta",
"url": "pages/codigo-de-conducta.html",
"children": None,
},
"coordinación": {"title": "Coordinación", "url": "pages/coordinacion.html"},
"grupos": {"title": "Grupos", "url": "pages/grupos.html"},
"eventos": {
"title": "Eventos",
"url": "pages/eventos.html",
"children": None,
},
"recursos": {
"title": "Recursos",
"url": "pages/recursos.html",
"children": None,
},
"videos": {
"title": "Videos",
"url": "pages/videos.html",
"children": None,
},
}
# Social widget
PLATAFORMAS = {
"discord": {
"alt": "Discord",
"icon": "fa-discord",
"url": "https://discord.gg/dTHMfJvauS"
},
"telegram": {
"alt": "Telegram",
"icon": "fa-telegram",
"url": "https://t.me/pythonchile"
},
}
REDES = {
"facebook": {
"alt": "Facebook",
"icon": "fa-facebook-f",
"url": "https://www.facebook.com/groups/pythonchiledev/",
},
"twitter": {
"alt": "Twitter",
"icon": "fa-x-twitter",
"url": "https://x.com/pythonchiledev",
},
"instagram": {
"alt": "Instagram",
"icon": "fa-instagram",
"url": "https://instagram.com/pythonchiledev",
},
"github": {
"alt": "Github",
"icon": "fa-github",
"url": "https://github.com/python-chile"
},
"linkedin": {
"alt": "LinkedIn",
"icon": "fa-linkedin",
"url": "https://www.linkedin.com/groups/4929519/",
},
"youtube": {
"alt": "YouTube",
"icon": "fa-youtube",
"url": "https://www.youtube.com/c/PythonChile",
},
"meetup": {
"alt": "Meetup",
"icon": "fa-meetup",
"url": "https://meetup.com/es/pythonchile",
},
}
PLUGINS = ["pelican.plugins.image_process"]
IMAGE_PROCESS = {
"large-photo": {
"type": "responsive-image",
"sizes": (
"(min-width: 1200px) 800px, "
"(min-width: 992px) 650px, "
"(min-width: 768px) 300px, "
"90vw"
),
"srcset": [
("600w", ["scale_in 600 450 True"]),
("800w", ["scale_in 800 600 True"]),
("1600w", ["scale_in 1600 1200 True"]),
],
"default": "800w",
},
}
DEFAULT_PAGINATION = 6
PAGINATED_DIRECT_TEMPLATES = ["index", "archives"]
# Implement author metadata loading
from pelican import signals
def load_author_metadata(generator):
for author, articles in generator.authors:
author_slug = author.slug
author_file = os.path.join("authors", f"{author_slug}.md")
if os.path.exists(author_file):
with open(author_file, "r", encoding="utf-8") as f:
content = f.read()
# Manual frontmatter parsing to avoid PyYAML dependency
if content.startswith("---"):
parts = content.split("---", 2)
if len(parts) >= 3:
frontmatter = parts[1]
author.bio = parts[2].strip()
# Parse key-value pairs
metadata = {}
for line in frontmatter.splitlines():
if ":" in line:
key, value = line.split(":", 1)
metadata[key.strip()] = value.strip()
author.image = metadata.get("image")
author.github = metadata.get("github")
author.linkedin = metadata.get("linkedin")
author.twitter = metadata.get("x") or metadata.get("twitter")
author.website = metadata.get("website")
author.name = metadata.get("nombre") or author.name
# Connect signal directly
signals.article_generator_finalized.connect(load_author_metadata)
# Uncomment following line if you want document-relative URLs when developing
# RELATIVE_URLS = True