This repository is an example repo that any NCAR or UCAR staff or project can use as a starting point for their own GitHub Pages site. Essentially, GitHub Pages is a static website server built in to every GitHub repository. GitHub Pages serves static HTML, CSS, JS, images, PDFs, text files, etc, but does not support dynamic scripting languages like PHP, Perl, Python, etc.
Koru-Jekyll Template uses the Koru-Jekyll theme, which is based on UCAR/NCAR's custom 'Koru' design, utilizing the same templates, colors, fonts, etc as the main NCAR and UCAR Umbrella sites. Koru-Jekyll is implemented as a Jekyll theme. Jekyll is a static site generator built in to GitHub Pages to allow you to generate HTML and static assets from Markdown files.
View an example GitHub Pages site generated from this repo.
Koru-Jekyll and Koru-Jekyll Template are developed and supported by SWES in CISL.
Koru-Jekyll is built on top of the Foundation for Sites HTML framework. This provides users and developers with responsiveness and accessibility. Content can be written in Markdown or HTML. Some familiarity with Git/GitHub and HTML/Markdown is beneficial, but not necessary.
You can serve a GitHub Pages site from a new or existing repository.
First, decide where to house the publishing source in your repo. You can choose the master branch, a "gh-pages" branch, or a "/docs" folder in your master branch. This is where the source files for your website will live. As an example, let's choose a "/docs" folder in the master branch:
As mentioned above, GitHub Pages is just a static website server, so any files you place in your repo within your publishing source will be served from your website.
You may want to edit basic site configuration in _config.yml with your values. For instance, the Site Title is configured in this file. Read more about configuration.
There are two layout options: "default" and "frontpage".
The only front matter information required for default pages is:
---
layout:
title:
---
Front matter options for the front page are:
---
layout:
title:
banner-title:
banner-description:
banner-button-text:
banner-button-url:
---
The main menu is set in the mainmenu.yml file in the _data directory. Paths can be either absolute or relative in the menu. The structure for creating a menu is:
menu:
- title: Software
url: /pages/documentation.html
If you are using a relative path to a page in the repository you will need to include the repository name in the url:
value. This would look like: url: /koru-jekyll-template/pages/main-menu.html
When developing locally, you will need to remove the repository name from the URL.
To add Google Analytics code to your site:
There is no "preview" facility in GitHub Pages. You will need to stand up your site locally instead, and a Docker container is provided for this in the repo. You will need Docker installed on your local computer.
Run docker-compose up --build
to (re)build the jekyll images and run the container.
This will create a container and mount your current repository directory on the container. The container runs jekyll serve
and creates a local server environment in the container. Once the container is up and running, a local version of your site will be available at http://localhost:4000.
Any changes you make to your local repository will be made to the container. To see updates you will need to refresh your browser.
GitHub has documentation on setting up a custom domain for your site. If you do not manage the DNS of your custom domain, you may contact SWES for support.
IMPORTANT: Once you create a CNAME file in your GitHub Pages site repository to configure your custom domain, DO NOT DELETE IT, or you may lose access to your site.
SWES occasionally pushes out updates to the Koru-Jekyll theme. To apply those changes to your site, you need to update the version of Koru-Jekyll that your site is using. Go to the _config.yml file and update the remote_theme: ncar/koru-jekyll@
to the latest version. You can watch the Koru-Jekyll repository to be notified of new versions.
Sphinx documentation will not display correctly if both Jekyll and Sphinx are in the /docs directory. This is due to Jekyll ignoring all directories that begin with an underscore.
If you have a feature you would like to see added to this template, please contact EIP Web.