pelicanconf.py 4.91 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']
54 55 56 57
PLUGINS = ['ipynb.markup', 'pelican_dynamic', 'rst_directives', 'extract_toc',
           'calcul_reader', 'calcul_filters', 'rst_include', 'sitemap',
           'tipue_search', 'check_deadlinks', 'orphean_attachments']

58 59
# Useful for 'rst_include' plugin (elative to content directory)
RST_GLOBAL_INCLUDES = ['../plugins/rst_include/include.rst']
Marco Mancini's avatar
Marco Mancini committed
60

61
# For check-deadlinks plugin
62
DEADLINK_VALIDATION = False
63
DEADLINK_OPTS = {
64 65
    'timeout_duration_ms': 5000,
    'request_verify': True
66 67
}

68 69 70 71 72 73 74
# For orphean_attachments plugin
ORPHEAN_VALIDATION = True
ORPHEAN_OPTS = {
    'prefix':  'attachments',
    'action':  'list'
}

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

gouarin's avatar
gouarin committed
82
CIRCLES = {'journee': 'Nos journées',
83
           'formation': 'Nos formations',
84
           'job': 'Offres d\'emploi'}
85

Matthieu Boileau's avatar
Matthieu Boileau committed
86
# PLUGINS.append('pelican-plugins.sitemap')
Matthieu Boileau's avatar
Matthieu Boileau committed
87 88 89 90 91 92 93 94 95 96 97 98 99 100

SITEMAP = {
    'format': 'xml',
    'priorities': {
        'articles': 0.5,
        'indexes': 0.5,
        'pages': 0.5
    },
    'changefreqs': {
        'articles': 'monthly',
        'indexes': 'daily',
        'pages': 'monthly'
    }
}
101 102 103 104 105 106 107 108

MARKDOWN = {
    'extension_configs': {
        'markdown.extensions.meta': {},
        'markdown.extensions.nl2br': {},
    },
    'output_format': 'html5',
}
109 110 111 112

# Processors for custom metadata (see CalculReader)
CUSTOM_METADATA_PROCESSORS = {
    'start_date': lambda x, y: get_date(x),
113 114
    'end_date': lambda x, y: get_date(x),
    'expiration_date': lambda x, y: get_date(x),
115 116 117 118
}

# Mandatory metadata per category (see CalculReader)
CATEGORY_MANDATORY_METADATA = {
119 120
    'journee': {'place', 'start_date', 'end_date'},
    'formation': {'place', 'start_date', 'end_date'},
121
}
Roland Denis's avatar
Roland Denis committed
122

123 124 125 126 127
# 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
128
}
129 130

# Follow-us link
Roland Denis's avatar
Roland Denis committed
131 132
# 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)"
133 134 135 136 137

# 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'
138 139 140 141

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

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

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

163 164
# Slug automatically generated from the article's file name
SLUGIFY_SOURCE = 'basename'
165 166 167

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