This is a port of the HPSTR Theme to the Pelican static site generator.
All credits for the initial Jekyll theme go to Michael Rose
Pelican blogging system comes with additional plugins that you can install and activate for your website. For more information see the pelican-plugins repository.
Here are the plugins that should work out of the box with that theme if enabled:
Displays related articles at the bottom of a blog post being read.
Extends the translations functionality by creating internationalized sub-sites for the default site. Also takes care of translating theme items.
This theme has some items / texts marked as localized in templates files. It relies on the [Jinja2 i18n extension] (http://jinja.pocoo.org/docs/templates/#i18n) to do the job and replace these texts with their translated couterparts in the appropriate language.
It means that you need to enable the jinja2.ext.i18n extension by adding the following line to your pelican configuration :
JINJA_EXTENSIONS = ['jinja2.ext.i18n']
THIS IS MANDATORY, please don't skip this step otherwise you won't be able to generate the website.
You downloaded this theme and love it but unfortunately your favorite language is not supported ? -> We need you !
You can optionally declare a Creative Commons license for the content of your site. It will appear in the site's footer. To enable, use one of the following two ways for configuration.
CC_LICENSE
to the common abbreviated name of the license: "CC-BY"
(require attribution), "CC-BY-SA"
(require ShareAlike), "CC-BY-ND"
(NoDerivatives) , "CC-BY-NC"
(require attribution, no commercial reuse), "CC-BY-NC-SA"
(require ShareAlike, no commercial reuse), or "CC-BY-NC-ND"
(NoDerivatives, no commercial reuse).CC_LICENSE_DERIVATIVES
- "yes"
if permitted, "no"
if not permitted, and "ShareAlike"
if derivatives must be shared under the same terms.CC_LICENSE_COMMERCIAL
- "yes"
if commercial reuse is permitted, and "no"
otherwise.CC_ATTR_MARKUP
to True.The license choice mirrors the Creative Commons License Chooser. Source for the macro that renders the mark is at http://github.com/hlapp/cc-tools.
The footer will display a copyright message using the AUTHOR variable and the year of the latest post. If a content license mark is enabled (see above), that will be shown as well.
pelicanconf.py
configuration file#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# Required as some texts in this theme templates are localized with gettext
JINJA_EXTENSIONS = ['jinja2.ext.i18n']
# User info
AUTHOR = u'Your name'
AUTHOR_ABOUT = u'Your bio goes here. It shouldn't be super long but a good two sentences or two should suffice.'
SITENAME = u'Site Title'
SITEURL = ''
# Directories configuration
PATH = 'content'
ARTICLE_PATHS = ['posts']
# Any extra files should be added here
STATIC_PATHS = [
'extra',
'images'
]
EXTRA_PATH_METADATA = {
'extra/robots.txt': {'path': 'robots.txt'}
}
# By default we enable pretty highlighing in markdown:
MD_EXTENSIONS = ['codehilite(css_class=highlight)', 'extra', 'toc']
# Pagination
DEFAULT_PAGINATION = 3
# Categories
USE_FOLDER_AS_CATEGORY = False
DEFAULT_CATEGORY = 'Misc'
# Plugin path
PLUGIN_PATHS = ['../pelican-plugins']
PLUGINS = ['related_posts', 'sitemap', 'i18n_subsites']
# Theme
THEME = 'theme/pelican-hpstr'
# Theme options
BACKGROUND = 'bg_image.png'
ABOUT_PAGE = 'about.html'
# Social widgets
SOCIAL = (('github', 'https://github.com/yourname', 'GitHub'),
('twitter', 'http://twitter.com/yourname'),
('linkedin', 'http://fr.linkedin.com/in/yourname', 'LinkedIn'),)
# Social meta tags info
SOCIAL_META_ENABLED = True
SOCIAL_META = {
'google': '<GOOGLE_ID>',
'twitter': {
'creator': '@creator_id'
'site': '@site_id'
}
}
# Sitemap configuration
SITEMAP = {
'format': 'xml',
'priorities': {
'articles': 0.5,
'indexes': 0.5,
'pages': 0.5
},
'changefreqs': {
'articles': 'weekly',
'indexes': 'daily',
'pages': 'monthly'
}
}
# I18n
I18N_TEMPLATES_LANG = 'en'
publishconf.py
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
# Enable google analytics
GOOGLE_ANALYTICS = "YOUR TRACKING ID"
Having a problem getting something to work, have some questions or want an addition to this theme ? Ping me on Twitter @jonathan_dray or file a GitHub Issue.
As the original theme is licensed under the GNU General Public License, i choose to distribute the Pelican version under the same conditions. This theme is free and open source software, distributed under the GNU General Public License version 2 or later. So feel free to to modify this theme to suit your needs.