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

4 5 6 7 8
from __future__ import unicode_literals
import os

''' Initial Pelican setup '''

9
PATH = 'content'
10
THEME = 'theme/lgmag'
11 12
BASE_PATH = os.path.dirname(os.path.realpath(__file__))
OUTPUT_PATH = "output/"
13 14 15 16 17 18 19 20

# caching
# CACHE_CONTENT = True
# LOAD_CONTENT_CACHE = True
# CONTENT_CACHING_LAYER = 'generator'
# CHECK_MODIFIED_METHOD = 'md5'
STATIC_CHECK_IF_MODIFIED = True
STATIC_CREATE_LINKS = True
21 22 23

''' Content '''

24
# AUTHOR = 'Libre Graphics magazine team'
25
SITENAME = 'Libre Graphics magazine archives'
Ricardo Lafuente's avatar
Ricardo Lafuente committed
26
SITEURL = 'http://archive.libregraphicsmag.com'
27
SITE_DESCRIPTION = "The LGmag archives"
28
SITE_LOGO = '/theme/images/libregraphicsmag-logo.png'
Ricardo Lafuente's avatar
Ricardo Lafuente committed
29
TIMEZONE = 'Europe/London'
Ricardo Lafuente's avatar
Ricardo Lafuente committed
30
FOOTERTEXT = 'Libre Graphics magazine is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike</a> license (CC BY-SA). All content should be attributed to its individual author. All content without a stated author can be credited to <a href="http://libregraphicsmag.com/">Libre Graphics magazine</a>.'
31
# DEFAULT_LANG = 'en'
32
PLUGIN_PATHS = ["plugins", THEME + "/plugins"]
Ricardo Lafuente's avatar
Ricardo Lafuente committed
33
PLUGINS = ["assets", "autopages", "neighbors"]
34
CATEGORY_PAGE_PATH = "issue-pages"
35 36 37 38 39

DEFAULT_DATE_FORMAT = '%d %b %Y'

'''Other internal options'''

Ricardo Lafuente's avatar
Ricardo Lafuente committed
40 41 42
# order by filename
ARTICLE_ORDER_BY = 'source_path'

43 44 45 46 47 48
# Tag to use for featured posts (if you change this, be sure to also alter the templates)
FEATURED_TAG = 'featured'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
49 50
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
51 52 53 54 55 56 57 58 59 60 61 62 63 64
# Uncomment following line if you want document-relative URLs when developing
RELATIVE_URLS = True
DEFAULT_PAGINATION = False
# We use this to be able to omit the Date field from articles that do not need it
DEFAULT_METADATA = {'date': '2017-11-05'}
# Set up clean URLs
ARTICLE_URL = '{category}/{slug}/'
ARTICLE_SAVE_AS = '{category}/{slug}/index.html'
PAGE_URL = '{slug}/'
PAGE_SAVE_AS = '{slug}/index.html'
CATEGORY_URL = '{slug}/'
CATEGORY_SAVE_AS = '{slug}/index.html'
DRAFT_URL = 'private/{slug}/'
DRAFT_SAVE_AS = 'private/{slug}/index.html'
Ricardo Lafuente's avatar
Ricardo Lafuente committed
65 66
AUTHORS_URL = 'authors/index.html'
TAGS_URL = 'tags/index.html'
67 68
# Don't create author urls
AUTHOR_SAVE_AS = ''
69 70 71 72
# Static pages setup
STATIC_SAVE_AS = '{path}'
STATIC_URL = '{path}'
STATIC_PATHS = [
Ricardo Lafuente's avatar
Ricardo Lafuente committed
73
    'images',
74 75 76 77 78 79 80 81 82 83
    'extra/htaccess',
    'extra/robots.txt',
    'extra/favicon.ico',
    'files',
]
EXTRA_PATH_METADATA = {
    'extra/htaccess': {'path': '.htaccess'},
    'extra/robots.txt': {'path': 'robots.txt'},
    'extra/favicon.ico': {'path': 'favicon.ico'},
    'files': {'path': 'files'},
Ricardo Lafuente's avatar
Ricardo Lafuente committed
84
    'images': {'path': 'images'},
85
}
86 87

# Don't remove periods from category slugs
88 89 90
# we use the "issue" part to remove it so that the slugifier can work
# see https://github.com/getpelican/pelican/issues/2316 for why this is so
CATEGORY_SUBSTITUTIONS = [('issue', '', True)]
91

92 93 94 95 96 97 98 99 100 101
# Set up webassets plugin
ASSET_CONFIG = (
    ('sass_style', 'compact'),
    ('cache', False),
    ('manifest', False),
    ('url_expire', False),
    ('versions', False),
    ('sass_debug_info', False),
)
ASSET_SOURCE_PATHS = ['static', 'static/css']