Skip to main content

Clean and tidy theme for Pelican.

Project description

Plumage, a Pelican theme

Plumage is a clean and tidy theme for Pelican, a static site generator.

I initially created this theme for my blog, but it is now generic enough to be used by anyone.

Features

  • Standard Pelican views:

    Plumage article view Plumage categories view Plumage tiered tag list view
    Article Categories Tiered tag list
    Plumage archive view Plumage tag view Plumage authors view
    Collapsable yearly archives Tagged articles Authors
    Plumage archive view
    Faceted article browsing
  • Projects template:

    Plumage projects: code showcase Plumage projects: videos showcase Plumage projects: themes showcase
    Code showcase (source) Videos showcase (source) Themes showcase (source)
  • Based on Bootstrap v4.

  • Code syntax highlighting.

  • Site-wide static search via Tipue-search.

  • Bare YouTube links in articles gets rendered as embedded videos:

    Plumage YouTube link

  • Direct link to edit articles on GitHub:

    Plumage GitHub edit link

  • Magnifying glass overlays on images and zoom:

    Plumage image magnifying glass Plumage image zoom

  • External assets (Bootstrap, Jquery, etc...) uses CDNjs .

  • Disqus integration:

    Plumage disqus comments

Plugins

Plumage has built-in support for the following plugins and extensions:

Installation

This package is available on PyPi, so you can install the latest stable release and its dependencies with a simple pip call:

$ pip install plumage

Then, update your pelicanconf.py file, to reference the module and extra plugins:

import plumage

THEME = plumage.get_path()

PLUGINS = [
    ()
    "pelican_webassets",
]

Settings

Plumage can be customized by adding these optionnal parameters to your pelicanconf.py file:

Setting name Default value Description
ARTICLE_EDIT_LINK Generate an edit link besides each article. Can use %(slug)s to include dynamic article's slug in the link.
COPYRIGHT Additional copyright statement to add in the third column of the footer.
DISCLAIMER Overide the Disclaimer notice that gets displayed at the fourth column of the footer.
DISQUS_SITENAME Pelican can handle Disqus comments. Specify the Disqus sitename identifier here.
FAVICON_LINKS True Fetch link's icons from Google's favicons webservice.
GOOGLE_ANALYTICS Set to UA-XXXXXX-Y Property's tracking ID to activate Google Analytics.
LEFT_SIDEBAR HTML content to put as-is in the left sidebar.
LINKS_WIDGET_NAME "Links" Allows override of the name of the links widget.
LINKS A list of tuples (Title, URL) for links to appear in the second column of the footer.
MANUAL_LINKS When enabling this, you must pass the links (in LINKS & SOCIAL settins) not as tuples anymore, but as list, where every entry is formatted as you like
MENUITEMS A list of tuples (Title, URL) for additional menu items to appear at the beginning of the main menu.
RIGHT_SIDEBAR HTML content to put as-is in the right sidebar.
SITESUBTITLE A subtitle to appear in the header.
SITE_THUMBNAIL_TEXT Text displayed behind site's thumbnail.
SITE_THUMBNAIL Site's thumbnail URL as displayed in the header. Should be a square image of at least 80x80 pixels.
SOCIAL_WIDGET_NAME "Social" Allows override of the name of the “social” widget.
SOCIAL A list of tuples (Title, URL) to appear in the first columns of the footer.
TIPUE_SEARCH False Activate Tipue Search (javascript static search engine) into the site. Requires the tipue_search plugin.

Most of these parameters are similar to notmyidea's (Pelican's default theme). For usage example, please have a look into my own pelicanconf.py .

The theme is also sensible to this list of standard Pelican parameters :

  • ARCHIVES_SAVE_AS
  • AUTHOR
  • AUTHOR_SAVE_AS
  • AUTHORS_SAVE_AS
  • CATEGORIES_SAVE_AS
  • CATEGORY_FEED_ATOM
  • CATEGORY_FEED_RSS
  • DEFAULT_LANG
  • DEFAULT_PAGINATION
  • DISPLAY_PAGES_ON_MENU
  • DISPLAY_CATEGORIES_ON_MENU
  • FEED_ALL_ATOM
  • FEED_ALL_RSS
  • FEED_ATOM
  • FEED_DOMAIN
  • FEED_RSS
  • PAGINATION_PATTERNS
  • SITENAME
  • SITEURL
  • TAG_FEED_ATOM
  • TAG_FEED_RSS
  • TAGS_SAVE_AS

Code Syntax Highlighting

There is two alternatives, all relying on Pygments syntax highlighter, sharing most features, with some differences:

Feature CodeHilite Highlight
Clean copy and paste
Line numbering
Right justified numbers
Line start offset
Multiple line highlight
Nth line highlight
Filename
Long line wraps
Long line overflow (scrollbar)
Sticky left gutter
Line anchors WIP @ Pygments

Python Markdown CodeHilite

Just add this configuration to pelicanconf.py, which allows us to pass extra options to Pygments' HTML formatter:

MARKDOWN = {
    "extension_configs": {
        ()
        "markdown.extensions.codehilite": {
            "css_class": "codehilite",  # Defaults
            "linenums": True,
            "linenos": "inline",
            "linespans": "coderow",
            "lineanchors": "L",
            "anchorlinenos": True,
            "wrapcode": True,
        },
        "markdown.extensions.fenced_code": {},
        ()
    },
}

This will render this:

```{.shell-session hl_lines="8 11" linenostart="5" linenospecial="3" filename="~/code/foo.log"}
$ cat ./example.markdown
This is the content of the file:
→ java
→ rust
→ haskell
→ javascript

$ cat ./addendum.txt
This is extra content.

$ find ./ -iname "*.markdown" -print -exec bash -c 'cat ./addendum.txt >> "{}"' \;
./example.markdown
$ cat ./example.markdown
This is the content of the file:
→ java
→ rust
→ haskell
→ javascript

This is extra content.

```

Into this:

Plumage Python Markdown CodeHilite rendering

PyMdown Extensions' Highlight

Just add this configuration to your pelicanconf.py:

MARKDOWN = {
    "extension_configs": {
        ()
        "pymdownx.highlight": {
            "linenums": True,
            "linenums_style": "pymdownx-inline",
        },
        "pymdownx.superfences": {},
        ()
    },
}

This will render this:

```{.shell-session hl_lines="8 11" linenums="5 1 3" filename="~/code/foo.log"}
$ cat ./example.markdown
This is the content of the file:
→ java
→ rust
→ haskell
→ javascript

$ cat ./addendum.txt
This is extra content.

$ find ./ -iname "*.markdown" -print -exec bash -c 'cat ./addendum.txt >> "{}"' \;
./example.markdown
$ cat ./example.markdown
This is the content of the file:
→ java
→ rust
→ haskell
→ javascript

This is extra content.

```

Into this:

Plumage PyMdown Extensions' Highlight rendering

FAQ

How can I disable the zoom on images?

All images of an article are zoomable by default. You can deactivate the magnifying glass per-image by adding a noZoom CSS class. So instead of the following Markdown code:

![Image title](/folder/image.png)

You have to use the following template to deactivate the zoom of an image:

![Image title](/folder/image.png){: .noZoom}

Why is the search not working?

The tipue-search needs to be installed then have an additional template file registered in your pelicanconf.py.

There are two alternatives:

  • update the TEMPLATE_PAGES variable:

    TEMPLATE_PAGES = {
        ()
        "search.html": "search.html",
     }
    
  • or DIRECT_TEMPLATES: (example):

    DIRECT_TEMPLATES = [(), "search"]
    

License

This software is licensed under the GNU General Public License v2 or later (GPLv2+).

Copyright (C) 2012-2020 Kevin Deldycke and contributors. All Rights Reserved.

Third-party assets

The theme embed copies of some external softwares, scripts, libraries and artworks:

Tipue Search v7.1
Copyright (c) 2019 Tipue
Distributed under a MIT license
Source: https://web.archive.org/web/20200703134724/https://www.tipue.com/search/tipuesearch.zip
jQuery MGlass v1.1
Copyright (c) 2012 Younès El Biache
Distributed under a MIT license
Source: https://github.com/younes0/jQuery-MGlass
Fabric (Plaid)
Copyright (c) 2012 James Basoo
Distributed under a Creative Commons Attribution-ShareAlike 3.0 Unported license
Source: https://subtlepatterns.com/fabric-plaid/
Cream paper
Copyright (c) 2012 Devin Holmes
Distributed under a Creative Commons Attribution-ShareAlike 3.0 Unported license
Source: https://subtlepatterns.com/cream-paper/
Feather-alt icon v5.1.0
Copyright (c) 2020 Font Awesome project
Distributed under a Creative Commons Attribution 4.0 International license
Source: https://fontawesome.com/icons/feather-alt?style=solid
Macro shot of White Feather
Source: https://unsplash.com/photos/Sw7f58YJbc0

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

plumage-2.3.0.tar.gz (50.0 kB view details)

Uploaded Source

Built Distribution

plumage-2.3.0-py3-none-any.whl (57.8 kB view details)

Uploaded Python 3

File details

Details for the file plumage-2.3.0.tar.gz.

File metadata

  • Download URL: plumage-2.3.0.tar.gz
  • Upload date:
  • Size: 50.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.6

File hashes

Hashes for plumage-2.3.0.tar.gz
Algorithm Hash digest
SHA256 d433cf828b0612d237cd953179c1dac1ad93956848e6b1e4c35d27681835a41b
MD5 07b4851c0e1c49b64b1e93a051ae31a6
BLAKE2b-256 9124b8b0611933d005817c57b070920c9b1f23dba87161486b35ead97c1cc2af

See more details on using hashes here.

File details

Details for the file plumage-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: plumage-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 57.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.6

File hashes

Hashes for plumage-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9b565b71f75afa0f00761aabfc3b934f898eb421acfe56b1e49983d866ed480
MD5 a7daecfb9e9b626cf0d00131e9cecf4a
BLAKE2b-256 3063479058098a685033266dde146f55ba1d610d407b43545e89d6045fd5ada2

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