Apache Theme for ASF Pelican

The Apache Theme, created for use with ASF-Pelican for project websites, is available at github.com/apache/template-site/tree/main.theme.

It has two types of files:

  • Page templates
  • CSS stylesheets

Page templates

  • base.html - the main template. Other templates extend this template automatically, including those in the default Pelican theme.
  • page.html - this overrides Pelican's default/simple page.html, which includes <h1>{{ page.title }}</h1>. which we do not want.

Change base.html as necessary. Add new override templates if you need them.

See the Pelican documentation for information about inheritance from the simple theme.

CSS stylesheets

In this site the css included by base.html is in the content tree. There are site- or template-specific overrides to the stylesheet frameworks, but these are not done as Pelican specifies.

  • styles.css - consists of custom site CSS overrides. Edit as needed. Here we include the CSS for the ASF permalink style. This file is in the same directory as the html and is included inline with {% include "styles.css" %}.

Page metadata

This theme uses the following metadata:

  • Title. Used in base.html with <title>{{ page.title }}</title> to provide the page title.

  • Notice. This is notice text, which is typically a link to the license.

    {% if page.notice %}<!-- {{ page.notice }} -->{% endif %}

  • License. This is an alternative to Notice.

  • bodytag. This adds attributes to the <body> element. This is allows the main index.ezmd to have the same template, but with a different layout.

    <body{% if page.bodytag %} {{ page.bodytag }}{% endif %} >

Pelican settings

Manage Pelican settings in the pelicanconf.yaml file at the top level of the template.

Some important settings:

  domain: YOURSITE.apache.org
  logo: images/logo.png
  repository: https://github.com/apache/YOUR_REPO/blob/main/content/
  trademarks: Apache, the Apache feather logo, and "Project" are trademarks or registered trademarks

Pelican theme

This is a custom theme. Pelican templates use Jinja.

Pelican variables set in pelicanconf.py

Note: early users of this template worked with pelicanconf.py, which is not part of the latest release. This information is for their convenience.

SITENAME = u'Apache <pmc>'
SITEDOMAIN = '<pmc>.apache.org'
SITEURL = 'https://<pmc>.apache.org'
SITELOGO = 'https://<pmc>.apache.org/images/logo.png'
SITEDESC = u'<pmc desc>'
SITEREPOSITORY = 'https://github.com/apache/<pmc-site>/blob/<branch>/content/'
TRADEMARKS = u'Apache, the Apache feather logo, and <pmc> are trademarks or registered trademarks'
CURRENTYEAR = date.today().year

Copyright 2023, The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
Apache® and the Apache feather logo are trademarks of The Apache Software Foundation...