-
Notifications
You must be signed in to change notification settings - Fork 4
Editing the web site
Pages can be created or modified online via GitHub's online file editor (clicking "Edit Me" on the top right of the site's header will bring you to this this website) or, for advanced users, via a local installation of jekyll and the openspim.github.io site. (See our advanced user guide for jekyll set-up instructions)
Navigate to this repository and make sure you are viewing the master branch. Click Add file
then Create new file
from the drop-down.
Add a name for your file. File names should be lowercase, avoid symbols, and contain no spaces (use underscores or dashes instead, _
-
).
The front matter precedes the content of your page, and sets several parameters that help setup your page within the repository. Without the front matter, your page will not render correctly.
title: The title of your page.
layout: This sets the page's layout. Always use setting page
.
description: A short description of your page. Also used for the site's search engine.
Additional items can be: author: The name of the page's author
Find below an example front matter. You can copy and paste this code into the editor of a new page at the very top (lines 1-5). Replace the settings in the title
, and description
fields with details from the new page. Do not change the layout: page
setting.
---
title: Editing the Wiki
layout: page
description: This page explains how to write and edit pages.
---
This section will cover how to populate the content of your page, including: links to GitHub markdown resources, as well as guides on how to use this site's includes.
Markdown is plain-text syntax formatting, allowing a user to easily and cleanly modify text with italics, bold, lists, etc. As a GitHub pages hosted website, openspim.github.io uses the git
flavor of markdown. A basic Git markdown guide can be found here.
Includes provide more robust formatting options and are unique to this site. With includes, you can insert images, videos, and figures into a page. You can look at existing pages to see how they are being utilized.
Jekyll is a Ruby framework. The installation instructions below will also help you with Ruby installation (if required). The jekyll static site generator can be installed on Linux, MacOS and Windows. To install a local version of jekyll follow the instructions for your respective operating system here.
Once jekyll has been installed, clone the the openspim.github.io repository. Navigate to the cloned repository and run bundle install
to install the specific gems used in openspim.github.io. Once this is complete, it is a good idea to run bundle update
.
####Serve a local version of openspim.github.io
Now that the both jekyll and the respository are installed on your local machine, you can run the static site generator by navigating to the directory openspim.github.io was saved and running bundle exec jekyll serve
. Wait for a minute or two while it generates and then in your browser navigate to http://127.0.0.1:4000
. Any changes you make to any file in the directory will be detected by jekyll, regenerating the site to reflect the new changes.
####Create a new page
In /path/to/openspim.github.io, create a new text file i.e.
cat > your_page_name.md. NOTE: filenames should be lowercase, omit spaces, and end in
.md`.
From here, the front matter and content of the new page can be populated with a text editor of your choosing.
Images should be stored in /path/to/openspim.github.io/images
, documents in /path/to/openspim.github.io/documents
and videos should be uploaded to the YouTube OpenSPIM account