pelican-hpstr

pelican-hpstr

Port of jekyll-hpstr-theme to pelican

HPSTR Pelican Theme

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

What HPSTR brings to the table:

  • Responsive templates for post, page, and post index. Looks great on mobile, tablet, and desktop devices.
  • Gracefully degrades in older browsers. Compatible with Internet Explorer 8+ and all modern browsers.
  • Modern and minimal design.
  • Sweet animated menu.
  • Readable typography to make your words shine.
  • Support for large images to call out your favorite posts.
  • Social Sharing links for Facebook, Twitter, and Google+ if you choose to enable.
  • FontAwesome 4.1.0 ready. Include any of the 439 available icons in your blog posts.
  • Google Analytics
  • Google Authorship, OpenGraph and Twitter Cards metadata for better SEO and sharing / distribution on social network plateforms
  • Semantic information via rdfa-lite in article (BlogPosting) and page (WebPage) templates

Supported plugins

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:

  • related posts

    Displays related articles at the bottom of a blog post being read.

  • i18n subsites

    Extends the translations functionality by creating internationalized sub-sites for the default site. Also takes care of translating theme items.

Localization | Translation

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.

Add translations for a language

You downloaded this theme and love it but unfortunately your favorite language is not supported ? -> We need you !

  1. Please follow these instructions for how to translate template items
  2. Make a pull request
  3. Receive many thanks from the community :)

Content license

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.

  • To choose the license by name, set 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).
  • Alternatively, choose the licence by features:
  • 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.
  • Optionally, you can include attribution markup in the license mark by setting 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.

Setup for an existing pelican website

  1. Clone this theme into your pelican's site theme directory
  2. Update your site 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'
  1. Deployement specific configuration publishconf.py
#!/usr/bin/env python
# -*- coding: utf-8 -*- #

# Enable google analytics
GOOGLE_ANALYTICS = "YOUR TRACKING ID"

Questions / Requests ?

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.

License

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.

jekyll logo

Want a Jekyll website built?

Hire a Jekyll developer