jekyll-theme

jekyll-theme

A Foundation for Public Code jekyll theme for use with GitHub pages.

Foundation for Public Code Jekyll theme

This is a Jekyll theme for the set up of quick generic static sites and for use with GitHub pages. The Foundation for Public Code uses this on all of its website for consistency and maintainability. We've designed this to keep as much content as possible in Markdown to preserve mutability. Read more about how this codebase is updated and who's involved in decisionmaking.

This project is meant internally for the Foundation for Public Code as we try to create version controlled single sources of truth and hyperlinked content that can be transformed and collated whenever needed.

Building locally

This theme is built to run predictably on GitHub pages, therefore the github-pages gem is required. Run bundle install before building with Jekyll.

To serve locally with Jekyll, use script/serve.sh

Customising

Table of contents

For your whole site

You can turn on the display of Table of Contents ('On this page' section) for any page by adding toc: true to the _config.yml

For just a specific page

Or adding toc: true to the front matter of any page where you want the Table of Contents to display.

You can turn on breadcrumbs for every page on the site by adding show_breadcrumbs: true to the config.yml.

Will result in breadcrumbs like:

Main index.md title > grandparent index.md title > parent index.md title

:warning: This will slow down the build as the partial needs to find the indexes and titles for every breadcrumb. This will likely add quite a bit of time to the generation of your site.

Metadata

If available, the metadata for a post will be displayed next to it. You can add metadata by adding front-matter as follows:

---
type: Guide
explains: something or other to put in this text here or there or everywhere wherever it makes sense
author: Ben
audience: Everyone
expires: 2019-04-22
bpmn: process.bpmn
---

The expires date is rendered by javascript and will highlight when expired.

The bpmn takes a filename and will draw a BPMN diagram.

Redirecting from a page

In order to redirect a page use the redirected layout by adding the following front-matter:

type: Resource
layout: redirected
sitemap: false
redirect_to: https://example.net/some-url

This is how we redirect pages.

You can remove the footer with the contact information and higher level navigation to the footer by setting hide_foundation_footer: true in the _config.yml.

⚠️ This feature is experimental and might be removed.

You can turn on the navigation by adding show_navigation: true to the _config.yml. The position of items can be set on the order property in the front-matter or in the _config.yml. You can hide a page by setting hidden: true.

Rendering the title seperately

You can render the title, which is often automatically extracted as the first H1 in the document by setting the Jekyll titles from headings to strip the titles:

titles_from_headings:
  strip_title: true

Language

The lang configuration is used in the html tag lang attribute.

Licence

© Foundation for Public Code 2018

The code in this repository is licensed under EUPL 1.2.

Logos, brands and trademarks of the Foundation for Public Code are licensed differently, check out https://brand.publiccode.net/ for more information.