aboutsummaryrefslogtreecommitdiffstats
path: root/pelicanconf.py
blob: a3d6f6e17ad45309e0eca21ebfd6599fee23488a (plain)
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# -*- coding: utf-8 -*- #

from __future__ import unicode_literals

# from pelican import __version__ as PELICAN_VERSION

# Basic settings
# https://docs.getpelican.com/en/stable/settings.html#basic-settings
DEFAULT_CATEGORY = 'Sin categoría'
DELETE_OUTPUT_DIRECTORY = False
DISPLAY_CATEGORIES_ON_MENU = True
DISPLAY_PAGES_ON_MENU = True
MARKDOWN = {
    'extension_configs': {
        'markdown.extensions.toc': {
            'title': 'Tabla de Contenidos',
            'permalink': 'true'
        },
        'markdown.extensions.codehilite': {
            'css_class': 'highlight',
            # 'linenums': None
        },
        'markdown.extensions.extra': {},
        'markdown.extensions.footnotes': {
            'BACKLINK_TITLE': 'Volver a la nota %d en el texto'
        },
        'markdown.extensions.meta': {},
    },
    'output_format': 'html5',
}
# Fix issue with < and > characters (among others) being double-escaped
# Bug report in markdown/extensions/codehilite.py
# https://github.com/Python-Markdown/markdown/pull/726/files

PATH = 'content'
PLUGIN_PATHS = ['plugins']
PLUGINS = [
    'extract_toc',
    'get_app_version',
    'i18n_subsites',
    'neighbors',
    'pelican-css',
    'pelican-js',
    'sitemap',
    'tag-cloud',
    'tipue-search',
    'pelican_comments'
]

# Optional: 'comments' is the default
COMMENTS_DIR = ['comments']

AUTHOR = 'Jesús E.'
SITENAME = 'Conocimientos Libres'
SITENAME_SINGLE = 'CL'
SITEURL = 'https://conocimientoslibres.tuxfamily.org'
SOURCE_LINK = 'https://git.sr.ht/~heckyel/cl'

# URL settings
# https://docs.getpelican.com/en/stable/settings.html#url-settings
RELATIVE_URLS = True
ARTICLE_URL = '{slug}/'
ARTICLE_SAVE_AS = '{slug}/index.html'
CATEGORY_URL = 'category/{slug}/'
CATEGORY_SAVE_AS = 'category/{slug}/index.html'
CATEGORIES_URL = 'categories/'
CATEGORIES_SAVE_AS = 'categories/index.html'
TAG_URL = 'tag/{slug}/'
TAG_SAVE_AS = 'tag/{slug}/index.html'
TAGS_URL = 'tags/'
TAGS_SAVE_AS = 'tags/index.html'
AUTHOR_URL = 'author/{slug}/'
AUTHOR_SAVE_AS = 'author/{slug}/index.html'
YEAR_ARCHIVE_SAVE_AS = 'archives/{date:%Y}/index.html'
MONTH_ARCHIVE_SAVE_AS = 'archives/{date:%Y}/{date:%m}/index.html'
AUTHORS_URL = 'pages/créditos/'
AUTHORS_SAVE_AS = 'pages/créditos/index.html'
ARCHIVES_URL = 'archives/'
ARCHIVES_SAVE_AS = 'archives/index.html'
STATIC_PATHS = [
    '.htaccess',
    'heckyel_pub.asc',
    'robots.txt',
    'wp-content',
    'vendor'
]

PAGE_PATHS = ['pages']
PAGE_EXCLUDES = [
    'vendor',
    'wp-content'
]

ARTICLE_PATHS = ['articles']
ARTICLE_EXCLUDES = [
    'comments',
    'pages',
    'vendor',
    'wp-content'
]

# Time and date
# https://docs.getpelican.com/en/stable/settings.html#time-and-date
TIMEZONE = 'Europe/Madrid'
LOCALE = ('es_ES.UTF-8')

# Feed settings
# https://docs.getpelican.com/en/stable/settings.html#feed-settings
# feed generation is usually not desired when developing,
# set to true in publishconf.py
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None

# Pagination (https://docs.getpelican.com/en/stable/settings.html#pagination)
DEFAULT_PAGINATION = 3
PAGINATION_PATTERNS = (
    (1, '{base_name}/', '{base_name}/index.html'),
    (2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'),
)
PAGINATOR_LIMIT = 4

# Translations
# https://docs.getpelican.com/en/stable/settings.html#translations
DEFAULT_LANG = 'es'
TRANSLATION_FEED_ATOM = None

# Themes
# https://docs.getpelican.com/en/stable/settings.html#themes
THEME = 'cl-theme/'
SHOW_RECENT_POSTS = 3  # the number of recent posts to show

# Plugins' configuration (not from Pelican core)
TAG_CLOUD_STEPS = 5
TAG_CLOUD_MAX_ITEMS = 53
TAG_CLOUD_SORTING = 'random'
TAG_CLOUD_BADGE = True

SITEMAP = {
    'format': 'xml',
    'priorities': {
        'articles': 0.5,
        'indexes': 0.5,
        'pages': 0.5
    },
    'changefreqs': {
        'articles': 'yearly',
        'indexes': 'weekly',
        'pages': 'yearly'
    }
}

SOCIAL = {
    'diaspora': 'https://diasp.org/u/heckyel',
    'gnusocial': '#',
    'mastodon': 'https://masto.nobigtech.es/@heckyel',
    'matrix': '#',
    'mediagoblin': '#',
    'peertube': 'https://video.ploud.jp/video-channels/cl',
    'pixelfed': '#',
    'pump': '#'
}

I18N_UNTRANSLATED_ARTICLES = 'remove'
I18N_UNTRANSLATED_PAGES = 'remove'
I18N_SUBSITES = {
    'de': {
        'LOCALE': ('de_DE.UTF-8'),
        'AUTHORS_URL': ('pages/autoren/'),
        'AUTHORS_SAVE_AS': ('pages/autoren/index.html'),
        'MARKDOWN': {
            'extension_configs': {
                'markdown.extensions.toc': {
                    'title': 'Inhaltsverzeichnis',
                    'permalink': 'true'
                },
                'markdown.extensions.codehilite': {'css_class': 'highlight'},
                'markdown.extensions.extra': {},
                'markdown.extensions.footnotes': {
                    'BACKLINK_TITLE': 'Springe zurück zu footnote %d im text'
                },
                'markdown.extensions.meta': {},
            },
            'output_format': 'html5',
        }
    },
    'en': {
        'LOCALE': ('en_US.UTF-8'),
        'AUTHORS_URL': ('pages/authors/'),
        'AUTHORS_SAVE_AS': ('pages/authors/index.html'),
        'MARKDOWN': {
            'extension_configs': {
                'markdown.extensions.toc': {
                    'title': 'Table of Contents',
                    'permalink': 'true'
                },
                'markdown.extensions.codehilite': {'css_class': 'highlight'},
                'markdown.extensions.extra': {},
                'markdown.extensions.footnotes': {
                    'BACKLINK_TITLE': 'Jump back to footnote %d in the text'
                },
                'markdown.extensions.meta': {},
            },
            'output_format': 'html5',
        }
    },
    'eo': {
        'LOCALE': ('eo.UTF-8'),
        'AUTHORS_URL': ('pages/aŭtoroj/'),
        'AUTHORS_SAVE_AS': ('pages/aŭtoroj/index.html'),
        'MARKDOWN': {
            'extension_configs': {
                'markdown.extensions.toc': {
                    'title': 'Enhavtabelo',
                    'permalink': 'true'
                },
                'markdown.extensions.codehilite': {'css_class': 'highlight'},
                'markdown.extensions.extra': {},
                'markdown.extensions.footnotes': {
                    'BACKLINK_TITLE': 'Saltu al footnote %d en la teksto'
                },
                'markdown.extensions.meta': {},
            },
            'output_format': 'html5',
        }
    },
    'fr': {
        'LOCALE': ('fr_FR.UTF-8'),
        'AUTHORS_URL': ('pages/auteurs/'),
        'AUTHORS_SAVE_AS': ('pages/auteurs/index.html'),
        'MARKDOWN': {
            'extension_configs': {
                'markdown.extensions.toc': {
                    'title': 'Table des matières',
                    'permalink': 'true'
                },
                'markdown.extensions.codehilite': {'css_class': 'highlight'},
                'markdown.extensions.extra': {},
                'markdown.extensions.footnotes': {
                    'BACKLINK_TITLE': 'Revenir à la footnote %d dans le texte'
                },
                'markdown.extensions.meta': {},
            },
            'output_format': 'html5',
        }
    },
}
JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']}