pelicanconf.local.py 4.77 KB
Newer Older
1 2 3 4 5 6
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals

#Plugins
PLUGIN_PATHS = ["plugins"]
7
PLUGINS = ["mimic_hierarchy", "i18n_subsites", "sitemap", "gimp_mirrors", "tipue_search"]
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

# sitemap plugin settings
SITEMAP = {
    'format': 'xml',
    'priorities': {
        'articles': 1,
        'indexes': 0.5,
        'pages': 1
    },
    'changefreqs': {
        'articles': 'weekly',
        'indexes': 'weekly',
        'pages': 'weekly'
    }
}

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

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

PATH = 'content'

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

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

48 49 50 51 52 53 54 55 56 57 58
# Feed generation is usually not desired when developing
#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'
#AUTHOR_FEED_ATOM = None
#AUTHOR_FEED_RSS = None

59 60 61 62 63 64 65 66 67
#  # 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', '#'),)
68 69 70 71 72 73 74 75 76

DEFAULT_PAGINATION = False



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

# This will copy over these folders w/o modification
Pat David's avatar
Pat David committed
77
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', '.htaccess']
78 79

# This sets which directories will be parsed as pages (vs. news/articles)
80 81
# If a new directory is to be added under content/, make sure it gets added here.
PAGE_PATHS = ['about', 'frontpage', 'tutorials', 'books', 'develop', 'docs', 'donating', 'downloads', 'features', 'bugs', 'links', 'man', 'release-notes', 'screenshots', 'source', 'unix', 'search.md']
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108

ARTICLE_PATHS = ['news']

THEME = "./themes/newgimp"

PAGE_URL = "{slug}/"
#PAGE_SAVE_AS = "{slug}/index.html"
PAGE_SAVE_AS = "{slug}/{filename}"

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

# 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.
# 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
# This sets the "old" index.html page to be saved to /news/index.html.
INDEX_SAVE_AS = "/news/index.html"


TYPOGRIFY = True
TYPOGRIFY_IGNORE_TAGS = ['title']

DELETE_OUTPUT_DIRECTORY = True

109
MD_EXTENSIONS = ['fenced_code', 'codehilite(css_class=codehilite)', 'extra', 'headerid', 'toc(permalink=True)']
110 111 112 113 114 115 116 117 118 119 120 121 122

# Pagination testing stuff

DEFAULT_ORPHANS = 0
DEFAULT_PAGINATION = 10

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

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