Skip to main content

Bulrush theme for Pelican

Project description

Bulrush

A Bulma-based Pelican blog theme; clean, flexible and responsive.

Screenshot - Bulrush at 1440px

The icons are from Font Awesome by Dave Gandy. The pure HTML/CSS "Fork me on GitHub" ribbon is based on github-fork-ribbon-css by Simon Whitaker; I modified it to be flatter.

Features

  • Responsive design - four column layout on desktop (≥980px), three column on tablet (≥769px), single column on mobile. Tabbed navigation bar collapses into drop-down "burger menu" on mobile.

  • Meta tagging functionality - support for Open Graph and Twitter Cards meta tags, giving enhanced display when sharing articles on social media sites (note: currently only available for articles and pages).

  • Printable layouts - the navigation is hidden when printed, avoiding wasted space.

  • Custom styling - additional CSS files can be included to customise the default styling.

  • Service integrations - including Disqus, GitHub, Google Analytics and MailChimp.

  • PyPI package available - so it can be pip install-ed.

  • Mermaid integration - so you can include generated diagrams.

Installation

Bulrush is available via the Python Package Index, so you can install it with:

pip install bulrush

The main exports from the module are:

  • PATH: the path to the theme;
  • FILTERS: the additional Jinja filters used by the theme; and
  • ENVIRONMENT: the Jinja environment required by the theme.

You can use them in your pelicanconf.py as follows:

import bulrush

THEME = bulrush.PATH
JINJA_ENVIRONMENT = bulrush.ENVIRONMENT
JINJA_FILTERS = bulrush.FILTERS

Other Requirements

You need to make the appropriate Pelican plugin, assets, available. One way of achieving this is to make the pelican-plugin repository a submodule of your site, then you can add to your pelicanconf.py:

PLUGIN_PATHS = ['pelican-plugins']
PLUGINS = ['assets']

Note: referencing the Pelican plugins in this way may have implications for the license of your project. See https://github.com/textbook/bulrush/issues/17.

Alternative

If you don't want to install the theme from PyPI you can simply give Pelican a relative path to the inner bulrush/ directory. For example, add bulrush as a submodule and set:

THEME = 'bulrush/bulrush'

In this case you will need to configure the environment and filters yourself and ensure that webassets is installed from PyPI.

Additional Screenshots

  • 480 x 480px (mobile):

    Screenshot - Bulrush at 480px

  • 840 x 480px (tablet):

    Screenshot - Bulrush at 840px

  • 980 x 480px (desktop):

    Screenshot - Bulrush at 980px

Settings

As well as the basic settings, Bulrush supports the following options in your pelicanconf.py:

Setting name What does it do?
BULRUSH_SHOW_SUMMARY A boolean, whether to show a summary rather than full article on index, category and tag pages. Defaults to False.
DISQUS_SITENAME Enables Disqus comments. Note that you should set up the full Comment Count Link, as no additional text is applied.
GITHUB_URL Enables the "Fork me on GitHub" ribbon.
GOOGLE_ANALYTICS Set to 'UA-XXXX-YYYY' to activate Google Analytics.
LICENSE A string or dictionary describing the license for the site; see details below.
LINKS A list of tuples ('Title', 'URL') for links to appear in the "blogroll" section of the sidebar.
MAILCHIMP Configure to activate a MailChimp sign-up form; see details below.
MERMAID Activate Mermaid diagram support; see details below.
MENUITEMS A list of tuples ('Title', 'URL') for items to appear in the tabbed navigation.
SITESUBTITLE A subtitle to appear in the header.
SOCIAL A list of tuples ('Title', 'URL') to appear in the "social" section of the sidebar.
TWITTER_USERNAME Enables Twitter meta-tags in the article and page headers.

If DISPLAY_CATEGORIES_ON_MENU is omitted or set explicitly to True, the categories are shown in the tabbed navigation with any MENUITEMS. If DISPLAY_PAGES_ON_MENU is omitted or set explicitly to True, they are listed in the sidebar with any SOCIAL or other LINKS.

Social Links

Appropriate icons are provided in the sidebar for a range of sites in the SOCIAL link list. Have a look in social.html to see which titles this applies to. If none of the sites are a match, then:

  • if the second, URL element in the tuple starts with 'mailto:', an envelope icon is used; otherwise
  • a globe icon is used.

Screenshot - Social icons in sidebar

MailChimp Configuration

If you're using MailChimp to handle a mailing list for your blog, you can configure a subscription form in the sidebar. You need to set three values to enable this, which you can get from the signup form creator. Simply look for the form action:

<form action="//user.region.list-manage.com/subscribe/post?u=abc123&amp;id=def456" ...

and extract the relevant sections:

MAILCHIMP = dict(
    domain='user.region.list-manage.com',
    user_id='abc123',
    list_id='def456',
    validation=True,  # enable jQuery validation
)

If you set validation=False (or leave it out entirely) you will reduce the page load (as it won't need 140KB of JavaScript) but won't get inline form submission or email validation.

You can also add rewards_url, providing your unique MonkeyRewards URL, to enable a "Powered by MailChimp" link.

License Settings

You can provide one of two options to specify the license for your content:

  • License name (str): The name of the license to display. Unless otherwise specified, a default icon (file-text-o) will be used and the entry will link to the current page.

    Creative Commons license names (e.g. 'CC BY-SA 4.0') are automatically recognised and an appropriate icon and link are generated.

  • License definition (dict): A dictionary specifying the name, url and optional icon (must be a Font Awesome icon name, default is file-text-o).

The license details will be displayed at the bottom of the sidebar on every page.

Mermaid Configuration

Enables Mermaid diagram generation on your site, allowing diagrams to be written in a Markdown-ish syntax. Simply wrap the code in a pre element with the mermaid class:

<pre class="mermaid">
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
</pre>

If you set MERMAID = True, this will simply enable Mermaid with some default settings:

  const defaults = {
    securityLevel: "loose",
    theme: "default",
    themeVariables: {
      fontFamily: 'BlinkMacSystemFont, -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif',
    },
  };

To override these settings, or any of Mermaid's own default configuration you can pass a dictionary instead. This will be shallowly merged into the defaults:

MERMAID = dict(
    securityLevel="strict",
    theme="forest",  # disables fontFamily override
)

Custom Styling

If any of the entries in EXTRA_PATH_METADATA have 'path's ending with '.css' they will be included in the base template, allowing the site style to be overridden as required. For example, in your pelicanconf.py:

# Static files
STATIC_PATHS = [
    'extra',
    ...
]
EXTRA_PATH_METADATA = {
    'extra/custom.css': {'path': 'custom.css'},
    ...
}

In use

Here are few current users of Bulrush (or modified versions of it):

If you'd like to be featured here (or are and would prefer not to be), feel free to submit a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bulrush-0.6.3.tar.gz (20.7 kB view details)

Uploaded Source

Built Distributions

bulrush-0.6.3-py3.11.egg (25.0 kB view details)

Uploaded Source

bulrush-0.6.3-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file bulrush-0.6.3.tar.gz.

File metadata

  • Download URL: bulrush-0.6.3.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for bulrush-0.6.3.tar.gz
Algorithm Hash digest
SHA256 5e860499b8d163077111a39c21d6d409a78e0e220e17de42a8eaf4baf6cd4099
MD5 acde7b0cb91b1e0acbd711a1081b53d9
BLAKE2b-256 5856310130684ebd0c6796e7d3eed8c748d18466953883a34a9a12cab7b01b5f

See more details on using hashes here.

File details

Details for the file bulrush-0.6.3-py3.11.egg.

File metadata

  • Download URL: bulrush-0.6.3-py3.11.egg
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for bulrush-0.6.3-py3.11.egg
Algorithm Hash digest
SHA256 d78f61f131639d69b9256c75b2e9a0e51129bdc34691c78061a13f07e50839e8
MD5 2a2925c20ed81caab3ab1090d1c7a2b3
BLAKE2b-256 da477b0362a01da66cf896789287d4c404de0c32d6f11f75150d5a010a91dec6

See more details on using hashes here.

File details

Details for the file bulrush-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: bulrush-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for bulrush-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f0d7846d83c49fec21472028cf85507681209115332cbaba82ef603f970eaf69
MD5 ddfeb88f223028839e45468a5f46dd80
BLAKE2b-256 08f1163ac22b1e41ce9aac7d76dbcc059c6e3a9d7eff35f116c49ac7ce8ed8db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page