pelicanconf.py 4.39 KB
Newer Older
1 2
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
3

4 5
from __future__ import unicode_literals

6
from mdx_figcaption import FigcaptionExtension
alexandre's avatar
alexandre committed
7
from mdx_outline import OutlineExtension
8

9 10

# Default author (usually your name).
11
AUTHOR = u'Balsamine'
12 13

# Your site name
14
SITENAME = u'Balsamine'
15 16 17 18 19 20

# Base URL of your website. Not defined by default, so it is best to specify
# your SITEURL; if you do not, feeds will not be generated with properly-formed
# URLs. You should include `http://` and your domain, with no trailing slash at
# the end. Example: `SITEURL = 'http://mydomain.com'`
#  SITEURL = 'http://balsamine.be'
21 22
SITEURL = ''

23 24 25
# Path to content directory to be processed by Pelican. If undefined, and
# content path is not specified via an argument to the `pelican` command,
# Pelican will use the current working directory.
26 27
PATH = 'content'

28

29 30 31 32 33
TIMEZONE = 'Europe/Paris'

DEFAULT_LANG = u'fr'

THEME = "theme/balsamine"
34 35
#  CSS_FILE = 'screen.css'
CSS_FILE = 'balsa.css'
36

37 38
# Whether to display categories on the menu of the template. Templates may or
# not honor this setting.
39
DISPLAY_CATEGORIES_ON_MENU = False
40 41 42

# Whether to display pages on the menu of the template. Templates may or may
# not honor this setting.
colm's avatar
colm committed
43
DISPLAY_PAGES_ON_MENU = True
44

45 46 47 48

ARTICLE_ORDER_BY = 'date'


49 50 51 52 53 54 55 56 57 58 59
# 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

# Social widget
SOCIAL = (('You can add links in your config file', '#'),
          ('Another social link', '#'),)

60
DEFAULT_PAGINATION = 100
61 62

# Uncomment following line if you want document-relative URLs when developing
63 64 65 66
# RELATIVE_URLS = True

# Global metadata to all the contents
DEFAULT_METADATA = {'color': '#CCCCCC'}
67 68 69


# Extends pelican for our specific needs
alexandre's avatar
wip  
alexandre committed
70
PLUGINS = [
alexandre's avatar
alexandre committed
71
    'minchin.pelican.plugins.image_process',
alexandre's avatar
wip  
alexandre committed
72 73
    'pelican_balsa',
]
74

colm's avatar
colm committed
75 76 77 78 79 80 81 82
# URL settings
ARTICLE_URL = '{category}/{slug}.html'
ARTICLE_SAVE_AS = '{category}/{slug}.html'
PAGE_URL = '{slug}.html'
PAGE_SAVE_AS = '{slug}.html'
# CATEGORY_URL = '{slug}.html'
# CATEGORY_SAVE_AS = '{slug}.html'

83 84 85 86 87 88

#  def tac_filter(value):
#      return value[::-1]

#  JINJA_FILTERS = {'tac': tac_filter }

89 90 91 92 93 94
def pagename(value, *args):
    val = "%s" % value
    return val.split("/")[-1].split(".")[0]

JINJA_FILTERS = {'pagename': pagename }

95 96 97 98 99
# Extra configuration settings for the Markdown processor. Refer to the Python
# Markdown documentation’s Options section for a complete list of supported
# options. The extensions option will be automatically computed from the
# extension_configs option.

100 101 102

MARKDOWN = {
    'extensions': [
alexandre's avatar
alexandre committed
103 104
        FigcaptionExtension(),
        OutlineExtension({"wrapper_tag": "div", "wrapper_cls": 'level%(LEVEL)d'})
105 106 107 108
    ],
    'extension_configs': {
        'markdown.extensions.extra': {},
        'markdown.extensions.meta': {},
alexandre's avatar
alexandre committed
109
        'markdown.extensions.toc': {"anchorlink": True}
110 111 112 113
        #  'markdown.extensions.attr_list': {},
    },
    'output_format': 'html5',
}
114 115 116 117

# A list of metadata fields containing reST/Markdown content to be parsed and
# translated to HTML.
# FORMATTED_FIELDS = ['summary']
alexandre's avatar
wip  
alexandre committed
118

alexandre's avatar
alexandre committed
119 120
# See <https://github.com/MinchinWeb/minchin.pelican.plugins.image_process> for
# configuration options
alexandre's avatar
wip  
alexandre committed
121
IMAGE_PROCESS = {
alexandre's avatar
alexandre committed
122
    'timeline': ["scale_in 420 9999 True"],
123 124
    'thumbnail': ["scale_in 9999 70 False"],
    'detail': ["scale_in 9999 600 False"],
125 126 127 128 129 130 131 132 133
    'responsive': {
        'type': 'responsive-image',
        'srcset': [
            ('1x', ["scale_in 800 600 True"]),
            ('2x', ["scale_in 1600 1200 True"]),
            ('4x', ["scale_in 3200 2400 True"]),
        ],
        'default': '1x',
    },
134 135 136 137 138 139 140 141 142 143 144 145
     'large': {
         'type': 'responsive-image',
         'sizes': '(min-width: 1200px) 800px, \
                   (min-width: 992px) 650px, \
                   (min-width: 768px) 718px, 100vw',
         'srcset': [
             ('70h', ["scale_in 999 70 True"]),
             ('200w', ["scale_in 200 400 True"]),
             ('500w', ["scale_in 500 600 True"]),
         ],
         'default': '500w',
     },
alexandre's avatar
alexandre committed
146
}
147

svilayphiou's avatar
svilayphiou committed
148
IGNORE_FILES = ["*.swo", "*.swp"]
alexandre's avatar
alexandre committed
149 150 151 152 153 154


# Fixes slow generation caused by overzealous copying of images
# Requires patched version of Pelican (see requirements.txt), at
# <https://github.com/aleray/pelican>
STATIC_CHECK_IF_MODIFIED = True
155

156 157 158 159 160 161 162

MENU_ITEMS = (
    ('La Balsamine', 'la-balsamine.html'),        
    ('Pratique', 'pratique.html'),
    ('Billeterie', 'billeterie.html'),
    ('Location', 'louer.html'),
)