dsp/pelicanconf.py

120 lines
2.7 KiB
Python

#
import os
AUTHOR = 'Андрей Астафьев'
SITENAME = 'ДСП'
SITEURL = 'https://dsp.246060.ru'
PATH = 'docs'
CACHE_PATH = 'cache'
TIMEZONE = 'Europe/Moscow'
DEFAULT_LANG = 'ru'
# Generation time
CACHE_CONTENT = True
LOAD_CONTENT_CACHE = True
# 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
USE_FOLDER_AS_CATEGORY = True
DEFAULT_DATE = 'fs'
STATIC_PATHS = ['images', 'files', 'extras']
DIRECT_TEMPLATES = ('index', 'categories', 'authors', 'archives')
EXTRA_PATH_METADATA = {
'extras/favicon.ico': {'path': 'favicon.ico'},
}
DISPLAY_CATEGORIES_ON_MENU = False
DISPLAY_CATEGORIES_ON_SIDEBAR = True
DISPLAY_TAGS_ON_SIDEBAR = True
THEME = 'themes/bootstrap4'
BOOTSTRAP_THEME = 'litera'
# I18N_GETTEXT_LOCALEDIR = 'translations'
# I18N_GETTEXT_DOMAIN = 'messages'
# Обязательно в виде массива
I18N_TEMPLATES_LANG = ['ru']
I18N_GETTEXT_NEWSTYLE = True
JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']}
PLUGIN_PATHS = ["plugins/official", "plugins/thirdparty"]
PLUGINS = ["css", "i18n_subsites", "pandoc-reader", "pelidoc", "replacer",
"search", "series", "subcategory", "tag_cloud"]
# PLUGINS = ["better_tables", "just_table"]
TEMPLATES_PATH = "templates"
PANDOC_READER_HTML_TEMPLATE = "wiki"
PANDOC_OUTPUTS = {
'pdf': 'pdf',
}
PANDOC_ARGS = [
"--variable=documentclass:extarticle",
"--variable=toc-title:Содержание",
"--highlight-style=tango",
"--filter=skip-toc-tag",
"--filter=pandoc_plantuml_filter.py",
"--template=wiki",
"--resource-path=wiki:."
]
PANDOC_EXTRA_OPTIONS = PANDOC_ARGS + ["--pdf-engine=xelatex"]
PANDOC_MARKDOWN_EXTENSIONS = [
"+smart",
"+backtick_code_blocks",
"+fenced_code_blocks",
"+fenced_code_attributes",
"+fenced_divs",
"+native_divs",
"+bracketed_spans",
"+native_spans"
]
PANDOC_EXTENSIONS = PANDOC_MARKDOWN_EXTENSIONS
REPLACES = (
('{}/docs/'.format(os.getcwd()), u''),
)
YUICOMPRESSOR_EXECUTABLE = "yui-compressor"
YUICOMPRESSOR_EXTRA_OPTIONS = ["--nomunge"]
if 'COMPRESS' in os.environ:
PLUGINS += ["yuicompressor-opt"]
PDF_PROCESSOR = True
# Blogroll
LINKS = ()
# LINKS = (('Pelican', 'https://getpelican.com/'),
# ('Python.org', 'https://www.python.org/'),
# ('Jinja2', 'https://palletsprojects.com/p/jinja/'),
# ('You can modify those links in your config file', '#'),)
# Social widget
SOCIAL = ()
# SOCIAL = (('You can add links in your config file', '#'),
# ('Another social link', '#'),)
PYGMENTS_STYLE='pastie'
DEFAULT_PAGINATION = 20
# Uncomment following line if you want document-relative URLs when developing
RELATIVE_URLS = True