pelicanconf.py 4.88 KB
Newer Older
Marco Mancini's avatar
Marco Mancini committed
1
2
3
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
4
from pelican.utils import get_date
Marco Mancini's avatar
Marco Mancini committed
5
6
7
8
9
10
11

AUTHOR = 'calcul@math.cnrs.fr'
SITENAME = 'groupe Calcul'
SITEURL = ''

PATH = 'content'

Matthieu Boileau's avatar
Matthieu Boileau committed
12
13
STATIC_PATHS = ['static/robots.txt', 'static/spip.php.py', 'static/.htaccess',
                'job_offers']
14
15
EXTRA_PATH_METADATA = {
    'static/robots.txt': {'path': 'robots.txt'},
16
    'static/spip.php.py': {'path': 'spip.php.py'},
17
    'static/.htaccess': {'path': '.htaccess'},
18
    }
19
READERS = {'html': None}  # prevent html attachments from being processed
20

21
22
IGNORE_FILES = ['__pycache__', '*.swp']

Marco Mancini's avatar
Marco Mancini committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
TIMEZONE = 'Europe/Paris'

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

# Blogroll
LINKS = (('Pelican', 'http://getpelican.com/'),
         ('Python.org', 'http://python.org/'),
         ('Jinja2', 'http://jinja.pocoo.org/'),
         ('You can modify those links in your config file', '#'),)

# Social widget
SOCIAL = (('@GroupeCalcul', 'https://twitter.com/GroupeCalcul'),)

43
DEFAULT_PAGINATION = False
Marco Mancini's avatar
Marco Mancini committed
44
45

# Uncomment following line if you want document-relative URLs when developing
Matthieu Boileau's avatar
Matthieu Boileau committed
46
# RELATIVE_URLS = True
Marco Mancini's avatar
Marco Mancini committed
47

48
THEME = 'themes/calcul/'
Matthieu Boileau's avatar
Matthieu Boileau committed
49
50
# Defined so that the authors page is not generated
DIRECT_TEMPLATES = ['index', 'categories', 'archives', 'tags', 'search']
Marco Mancini's avatar
Marco Mancini committed
51
52
53
MARKUP = ('md', 'ipynb')

PLUGIN_PATHS = ['./plugins']
Matthieu Boileau's avatar
Matthieu Boileau committed
54
55
56
PLUGINS = ['ipynb.markup', 'pelican_dynamic', 'rst_directives', 'extract_toc',
           'calcul_reader', 'calcul_filters', 'rst_include', 'sitemap',
           'pelican-deadlinks', 'tipue_search']
57
58
# Useful for 'rst_include' plugin (elative to content directory)
RST_GLOBAL_INCLUDES = ['../plugins/rst_include/include.rst']
Marco Mancini's avatar
Marco Mancini committed
59

60
# For pelican-deadlinks plugin
61
DEADLINK_VALIDATION = False
62
63
64
65
DEADLINK_OPTS = {
    'archive': True,
    'classes': ['custom-class1', 'disabled'],
    'labels': True,
Matthieu Boileau's avatar
Matthieu Boileau committed
66
    'timeout_duration_ms': 4000,
67
    'timeout_is_error': False,
Matthieu Boileau's avatar
Matthieu Boileau committed
68
    'request_verify': False
69
70
}

71
72
MENUITEMS = [('Le groupe', '/pages/presentation_groupe.html'),
             ('Paysage du calcul', '/pages/paysage_du_calcul.html'),
gouarin's avatar
gouarin committed
73
74
             ('Nos journées', '/category/journee.html'),
             ('Nos formations', '/category/formation.html'),
75
             ("Offres d'emploi", '/category/job.html'),
Marco Mancini's avatar
Marco Mancini committed
76
77
             ]

gouarin's avatar
gouarin committed
78
CIRCLES = {'journee': 'Nos journées',
79
           'formation': 'Nos formations',
80
           'job': 'Offres d\'emploi'}
81

Matthieu Boileau's avatar
Matthieu Boileau committed
82
# PLUGINS.append('pelican-plugins.sitemap')
Matthieu Boileau's avatar
Matthieu Boileau committed
83
84
85
86
87
88
89
90
91
92
93
94
95
96

SITEMAP = {
    'format': 'xml',
    'priorities': {
        'articles': 0.5,
        'indexes': 0.5,
        'pages': 0.5
    },
    'changefreqs': {
        'articles': 'monthly',
        'indexes': 'daily',
        'pages': 'monthly'
    }
}
97
98
99
100
101
102
103
104

MARKDOWN = {
    'extension_configs': {
        'markdown.extensions.meta': {},
        'markdown.extensions.nl2br': {},
    },
    'output_format': 'html5',
}
105
106
107
108

# Processors for custom metadata (see CalculReader)
CUSTOM_METADATA_PROCESSORS = {
    'start_date': lambda x, y: get_date(x),
109
110
    'end_date': lambda x, y: get_date(x),
    'expiration_date': lambda x, y: get_date(x),
111
112
113
114
}

# Mandatory metadata per category (see CalculReader)
CATEGORY_MANDATORY_METADATA = {
115
116
    'journee': {'place', 'start_date', 'end_date'},
    'formation': {'place', 'start_date', 'end_date'},
117
}
Roland Denis's avatar
Roland Denis committed
118

119
120
121
122
123
# Twitter configuration
TWITTER = {
    'user': 'groupecalcul',     # Twitter account name.
    'carousel_count': 3,        # Number of tweets in the carousel.
    'carousel_interval': 5000,  # Delay before automatic cycle of the carousel.
Roland Denis's avatar
Roland Denis committed
124
}
125
126

# Follow-us link
Roland Denis's avatar
Roland Denis committed
127
128
# Spaces are not allowed in url, use %20 instead
FOLLOW_US_LINK = "mailto:sympa@listes.math.cnrs.fr?subject=subscribe%20calcul%20prénom%20nom&body=(pensez%20à%20remplacer%20prénom%20et%20nom%20dans%20le%20sujet)"
129
130
131
132
133

# Article sort order ('reversed-' prefix to reverse the sort order).
# sort_key is generated by the customs readers from the date and
# start_date metadata.
ARTICLE_ORDER_BY = 'reversed-sort_key'
134
135
136
137

# Highlighted article
# If the selected article is finished, the last event is selected.
HIGHLIGHT_SETTINGS = {
Matthieu Boileau's avatar
Matthieu Boileau committed
138
139
    'categories': {'journee', 'formation'},  # Filter article category
    'article': 'next',  # 'next' (next event), 'date' (last added) or its slug.
140
}
Matthieu Boileau's avatar
Matthieu Boileau committed
141
SUMMARY_MAX_LENGTH = 0  # Disable automatic generation of the summary
142
143

# Job offer tags (tag to name)
Matthieu Boileau's avatar
Matthieu Boileau committed
144
145
# If you add a tag here, you should also update
# the content/job_offers/add_job_offer.py script.
146
147
148
149
150
151
JOB_OFFER_TAGS = {
    'cdi': 'CDI',
    'cdd': 'CDD',
    'postdoc': 'Post-doc',
    'these': 'Thèse',
    'stage': 'Stage',
152
    'concours': 'Concours',
153
}
154
155

# We don't need authors pages
Roland Denis's avatar
Roland Denis committed
156
157
158
# See https://github.com/getpelican/pelican/issues/1729#issuecomment-105239639
AUTHOR_SAVE_AS = ''

159
160
# Slug automatically generated from the article's file name
SLUGIFY_SOURCE = 'basename'
161
162
163

# Don't automatically extract the category from the article's subfolder
USE_FOLDER_AS_CATEGORY = False