This website was created using jekyll and GitHub Pages.
Jekyll is a static site generator that takes care of updating a site template with contents of our chosing, which we can provide via markdown files.
The site template is Hyde (see repo for more details) with some of our own modifications.
Included are instructions for how to update the team website with a focus on the content rather than styling.
(only highlighting folders and files relevant to updating site)
/
├── index.md
├── 1research.md
├── 2ds_platform.md
├── 3people.md
├── 4tools.md
├── 5education.md
├── 6contact.md
├── README.md
├── _config.yml
├── _includes/
│ ├── head.html
│ └── sidebar.html
├── _layouts/
│ ├── default.html
│ └── page.html
├── _site/
└── public/
├── assets/
└── css/
- How jekyll knows to work its magic on a markdown or html file is based on the file's YAML front matter block.
e.g.,
---
layout: page
title: About
permalink: /about/
---
- no front matter = not included in the website (e.g., jekyll knows not to include this README.md you are reading because there is no front matter)
- Main takeaway: To update the contents of the website you will only need to add/remove/update the markdown files with front matter in the main directory. (e.g., 3people.md) More instructions in Updating website content.
- Do not alter the files in
_includes
,_layouts
for now.
-
How jekyll knows to work its magic on a markdown or html file is based on the file's YAML front matter block.
-
Currently, there are 2 page layouts (templates) used in our site:
default
via /_layouts/default.htmlpage
via /_layouts/page.html`
-
The way that the styling is merged with the markdown files is via
layout
in the front matter: e.g.,--- layout: page title: About permalink: /about/ ---
-
layout: page
is to be used for almost all of the pages you want included in the site -
layout: default
is only used for the home page index.md because it has some additional formatting + appears as the first option in the top menu barFrom the Hyde repo: "Why require a specific layout? Jekyll will return all pages, including the
atom.xml
, and with an alphabetical sort order. To ensure the first link is Home, we exclude theindex.md
page from this list by specifying thedefault
layout."
- To update the contents of the website you will only need to add/remove/update markdown files in the main directory.
- To incorporate images or any other files into the site please put them in
/public/assets/
If you want to test/preview the site locally as you make changes
- install jekyll
- in your terminal cd into the site's repo
- then run
jekyll serve --watch
- open the url in
Server address: ...
- To preview your changes don't forget to save your file and refresh the browser.
- Clone this repository
- Create a branch from the 'master' branch of THIS repository (not the poole/hyde one)
- In the main directory, open the markdown file you want to update e.g. 3people.md
- make whatever changes to the content you want
- save the file
- push the changes to your branch
- Make a pull request for your branch into the MoNA's
Master
branch (:warning: NOT poole/hyde) then jekyll will take care of the rest
(it's that easy 😃)
Let's say you want to add a 'Contact' page and it should appear as the last option on the top menu bar
- Steps 1-3 in Updating an existing page
- Create a markdown file in the root directory. Since pages are sorted alphabetically, if you want the Contact page to be last in the menubar of the website, prefix the markdown filename with a '9' or 'z' for example
- In the markdown file, the front matter should look like this:
---
layout: page
title: Contact
permalink: /contact/
---
- the layout should be 'page', to tell jekyll to use the page.html layout
- the title is what will be used in the top menu bar
- assigning a permalink will overwrite the default of using the ugly filename (e.g.,
... .github.io/contact/
instead of... .github.io/9contact/
)
- Underneath the front matter include whatever content you would like. You can add formatting to the file using markdown or html syntax.
- Steps 5-7 in Updating an existing page
- similar steps to those in Updating an existing page
- However, the file that needs to be updated is
/_includes/sidebar.html
- Look for the
sidebar-nav-item
tags
- Recall that the site template is Hyde (see repo for more details) with some of our own modifications.
- Updates to formating is done in the 3 directories:
/_includes/
/_layouts/
and/public/
- Requires HTML and CSS
Please see hyde repo for more details Mark Otto
Open sourced under the MIT license.
<3