All announcements are located in the _posts
directory. They are written in Markdown (.md
). Files should be named YYYY-MM-DD-unique-title
.
Announcements will display all content on the news page. Unlike blog posts, be sure to omit layout
and preview
fields.
---
author: yourusername
title: Sample Announcement
date: 2018-09-09
categories: announcement
---
Content goes here and will be shown directly on the news list.
All blog posts are located in the /_posts
directory. Each file is a Markdown (.md
) file, just like announcements. Files should be named YYYY-MM-DD-unique-title
.
Instead of showing all content on the news list, they will have a preview field which is shown. Content will be shown on the blog post detail page. The preview
page is required or else the entire content of the blog post will be displayed on the news list. The layout
is required to display properly when clicked.
---
layout: blog
author: yourusername
title: Sample Blog Post
preview: Preview text is required. It is shown on the news list instead of the full content.
date: 2018-09-10
categories: blog
---
# Content goes here
This content is NOT shown on the news list, but will be shown on the detail page. To reach the detail page, the user will click on the "Read more..." link which is automatically generated.
## More stuff...
To keep things organized, pages are located in the pages
directory, with a directory structure mirroring the site. Configure the metadata:
---
layout: default
title: My Page
permalink: /my-page/
---
If you add a new page and want it to appear in the sidebar of that section (such as the sidebar under Docs), then you also need to update the yaml
file associated with that group. These are located under _data/
. For Docs, you would update docs_toc.yml
, following the structure that currently exists within that file.
Links should prepend site.baseurl
before the location. e.g.:
<link href="{{ '/assets/css/home.css' | prepend: site.baseurl }}" rel="stylesheet">
<img src="{{ '/assets/img/datahub_logo_black.png' | prepend: site.baseurl }}">
<a class="nav-link" href="{{ '/news/' | prepend: site.baseurl }}">NEWS</a>
You can run the site just like any other Jekyll site as documented or using a jekyll container.
- Ensure all of the requirements here are installed, as well as the
ruby-devel
library. - In the root of the repository, run:
bundle install
bundle exec jekyll serve
- Go to http://localhost:4000
- To automatically refresh after every change, use:
bundle exec jekyll serve --livereload
On running bundle install
you receive: Ignoring <package-version> because its extensions are not built. Try: gem pristine <package> --version <version>
This issue might stem from 2 cases:
- The package was installed on a previous Ruby version
- The package was installed when not all prerequisites were satisfied
The easiest solution is to delete the package explicitly with
sudo -i gem uninstall -i /usr/share/gems <package>
where /usr/share/gems
might be a different directory on your system.
It can then be reinstalled with bundle install
once all prerequisites are satisfied.
On running bundle exec jekyll serve you receive: Could not find <package>-<version> in any of the sources
See troubleshooting case 1.
On running bundle install
you receive: An error occurred while installing <package> (<version>), and Bundler cannot continue.
This is most likely caused by missing the ruby-devel
, gcc
or g++
libraries.
Run bundle add webrick
and retry.