pelicanconf.py 4.76 KB
Newer Older
Pat David's avatar
Pat David committed
1 2 3 4
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals

5 6
#Plugins
PLUGIN_PATHS = ["plugins"]
7
#PLUGINS = ["page_hierarchy_gimp"]
8
PLUGINS = ["mimic_hierarchy", "i18n_subsites", "sitemap", "gimp_mirrors", "tipue_search"]
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

# sitemap plugin settings
SITEMAP = {
    'format': 'xml',
    'priorities': {
        'articles': 1,
        'indexes': 0.5,
        'pages': 1
    },
    'changefreqs': {
        'articles': 'weekly',
        'indexes': 'weekly',
        'pages': 'weekly'
    }
}
24 25 26 27 28 29 30

# mapping: language_code -> settings_overrides_dict
I18N_SUBSITES = {
        'fr': {
            'SITENAME': 'GIMP FR',
            },
        }
31

Pat David's avatar
Pat David committed
32 33
AUTHOR = u'Pat David'
SITENAME = u'GIMP'
34
SITEURL = 'https://www.gimp.org'
35
SITEMAP_SITEURL = 'https://www.gimp.org'
36
#GIMP_VERSION = u'2.8.18'
Pat David's avatar
Pat David committed
37 38 39 40 41

PATH = 'content'

TIMEZONE = 'Europe/Paris'
DEFAULT_LANG = u'en'
42 43
DEFAULT_DATE_FORMAT = "%Y-%m-%d"

44 45 46 47 48
# Allow dating news posts in the future
# before then, they will automatically have
# Status: draft set
WITH_FUTURE_DATES = False

Pat David's avatar
Pat David committed
49
# Feed generation is usually not desired when developing
50 51 52 53 54 55 56
FEED_DOMAIN = SITEURL
FEED_ATOM = 'feeds/atom.xml'
FEED_RSS = 'feeds/rss.xml'
FEED_ALL_ATOM = 'feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'
TRANSLATION_FEED_ATOM = 'feeds/all-%s.atom.xml'
TRANSLATION_FEED_RSS = 'feeds/all-%s.rss.xml'
Pat David's avatar
Pat David committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
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 = (('You can add links in your config file', '#'),
          ('Another social link', '#'),)

DEFAULT_PAGINATION = False


73 74

# Pat David changes while building/testing
75 76
READERS = {'html': None}

77
# This will copy over these folders w/o modification
78
STATIC_PATHS = ['images', 'js', 'pages', 'tutorials', 'about', 'books', 'develop', 'docs', 'donating', 'downloads', 'features', 'bugs', 'links', 'man', 'release-notes', 'screenshots', 'source', 'unix', 'robots.txt', 'COPYING', 'GNUGPLv2', 'GNUGPLv3', 'news', 'contribute.json']
79

80
# This sets which directories will be parsed as pages (vs. news/articles)
81
# If a new directory is to be added under content/, make sure it gets added hereMarkdown.
82
PAGE_PATHS = ['about', 'frontpage', 'tutorials', 'books', 'develop', 'docs', 'donating', 'downloads', 'features', 'bugs', 'links', 'man', 'release-notes', 'screenshots', 'source', 'unix', 'search.md']
Pat David's avatar
Pat David committed
83

84 85
ARTICLE_PATHS = ['news']

86 87
THEME = "./themes/newgimp"

Pat David's avatar
Pat David committed
88
PAGE_URL = "{slug}/"
89 90
#PAGE_SAVE_AS = "{slug}/index.html"
PAGE_SAVE_AS = "{slug}/{filename}"
Pat David's avatar
Pat David committed
91 92 93 94

ARTICLE_URL = "news/{date:%Y}/{date:%m}/{date:%d}/{slug}/"
ARTICLE_SAVE_AS = "news/{date:%Y}/{date:%m}/{date:%d}/{slug}/index.html"

95 96 97
# This redirects the old standard output of blog/news/articles post
# summaries on the front page.  It will now appear at the location
# below instead.
98 99 100
# The _actual_ index.html page is located at:
# content/pages/index.md -> which simply calls the home.html template
# See: http://docs.getpelican.com/en/3.6.3/faq.html#how-can-i-use-a-static-page-as-my-home-page
Pat David's avatar
Pat David committed
101
# This sets the "old" index.html page to be saved to /news/index.html.
102 103
INDEX_SAVE_AS = "/news/index.html"

104

105
TYPOGRIFY = True
106 107 108
TYPOGRIFY_IGNORE_TAGS = ['title']

DELETE_OUTPUT_DIRECTORY = True
109

110
MD_EXTENSIONS = ['fenced_code', 'codehilite(css_class=codehilite)', 'extra', 'headerid', 'toc(permalink=True)']
111 112 113 114

# Pagination testing stuff

DEFAULT_ORPHANS = 0
Pat David's avatar
Pat David committed
115
DEFAULT_PAGINATION = 10
116 117 118

# Debug output on pages
# Seting to 'True' will show child/parent pages at bottom of pages
119 120 121 122 123
PAGES_DEBUG = False

# When developing, you probably want document relative URLs - so set this to True
# When publishing, set to False
RELATIVE_URLS = False
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

#
# Parse the GIMP_VERSIONS json file for use around the site
# (mostly the /downloads/index.html page)
#

import json
from collections import OrderedDict
with open('GIMP_VERSIONS') as data:
    GIMP = json.load(data, object_pairs_hook=OrderedDict)

if 'STABLE' in GIMP:
    # Set the current stable GIMP version from
    # the GIMP_VERSIONS json file.  The most
    # current version _should_ be the first key
    # hence, .keys()[0]
    GIMP_VERSION = GIMP['STABLE'].keys()[0]
    for version, info in GIMP['STABLE'].iteritems() :
        if 'windows' in info: 
            try:
                WINDOWS_FILE
            except NameError:
                WINDOWS_VER = version
                WINDOWS_FILE = info['windows'].keys()[0]
                WINDOWS_HASH = info['windows'].values()[0]
        if 'macos' in info:
            try:
                MACOS_FILE
            except NameError:
                MACOS_VER = version
                MACOS_FILE = info['macos'].keys()[0]
                MACOS_HASH = info['macos'].values()[0]
else:
    print 'STABLE not defined'