Skip to content

Editing using Github

Sam Osborne edited this page Aug 22, 2016 · 2 revisions

For more technical users, editing the site using a text editor and Github (or the Github Web Editor) can be a powerful and useful tool.

If not using the Github Web Editor, I'd recommend either Sublime Text or Atom in conjunction with Git installed. You may find Github for Desktop a useful client.

You will need:

  • A basic understanding of Git (commits, branches and general operation)
  • A testing environment (should you wish to preview your changes locally)

The Readme explains how to set up a development environment, and there are a huge array of online resources on using Git.

Once set up, the main difference from using our online editor (Forestry), is the way you change the settings for pages.

The main site configuration is in config.toml.

Configuration for the pages is done at the top of each file in what's known as the Front matter.

For top-level pages:

	date = "2016-07-17T15:46:07+01:00"
	description = ""
	draft = true
	image = "/img/about-bg.jpg"
	title = ""
	toc = true

For news posts, there are additional front matter parameters:

	author = []
	categories = [""]
	tags = [""]

The page description is shown below the main page title, so make it short and snappy.

The draft status determines whether the page will be generated or not. Set it as true to make it not generated, but feel free to commit draft pages to work on them later or share with others. Build draft pages locally with the -D flag in Hugo.

Image is the header image of the page. There is a default image, if none is set.

toc stands for Table of Contents and determines whether the contents will show or not. If set to true, the horizontal menu will show on all large devices, and link to each h1 tag on the page. If there are no h1 tags, the menu will not show.

author is the name of the person who wrote the post. The default (if left blank) is Beeston HQ.

tags and categories are used for organising our content. There is an explanation on how to use them on the home page of the Wiki.

Clone this wiki locally