Editing guide
Editing guide for the CEDA website
This site is built with a the Hugo static site builder using the Hinode theme , with styling customised for CEDA. This guide covers how to edit and update the various sections of the site.
Content is organised into the following main sections:
and is written in Markdown format, but with a few extra features provided by both Hugo and the Hinode theme template. It is worth reading the documentation for both of these to understand the syntax fully.
Two further links in the site’s navbar point to components whose content is managed elsewhere:
The site uses a system of templates to transform content in markdown format, into a set of static web pages. So all the different views of the site are pre-generated. So instead of there being an “admin” interface to edit the website as with previous platforms, editing is done by changing/adding to the source content, or modifying templates or configuration, then re-building the site.
New content gets published when the site is rebuilt. The site gets rebuilt when:
main
branch of the repositoryAfter initial setup, the edit/update process involves:
main
The following roles are in use for this site (corresponding to groups in our GitHub org). Your GitHub ID needs to be a member of the relevant group(s).
Your route to editing a news item will depend on your role:
News items are stored in the directory content/news/updates/YYYY
where YYYY
is the current year.
There is a template news item here, which can be copied as an example:
content/news/updates/2024/2024-03-06-an-example-news-item.md
But to do this, note the following:
YYYY-MM-DD-slug.md
, where
YYYY-MM-DD
is the publication date. If the year is 2024, this file should go in the 2024
directory.slug
is a CONCISE string representing the title (doesn’t have to be identical).md
format extension needs to be present, but is not used in the eventual URL of the articleInside the markdown file we have:
---
title: An example news item
date: 2024-03-06 10:30:00
tags: ['news', 'ceda']
thumbnail:
icon: fas circle-info text-info
draft: true # remove this line in your copy
---
No need to repeat the title as a heading here.
This is an example news item which can be copied to create a new one.
### Here's a heading
Here's some text (after a spacer line)
#### A subheading
And some more text, just before the blank line at the end.
Looking at the top section first:
---
and ---
.
Hugo allows frontmatter in YAML, TOML or JSON syntax: the separator symbol denotes which: ---
is for YAML. For this site, to keep things simple, we’ll stick to YAML as used above.For a full explanation see the documentation on Hinode Frontmatter , but the Frontmatter fields used above (and sufficient for a simple news item) are:
field | content | comment |
---|---|---|
title | Title of the post | Avoid quotes, ampersands or other symbols, be consistent with capitalisation. Don’t repeat the title in the markdown: the template does this for you in list & single views. Add other headings starting with ### Heading3 (because title gets rendered as ## Heading2 ). |
date | Publication date/time of the post | Must be in the format YYYY-MM-DD hh:mm:ss including the time with seconds. The date part should correspond with the filename. Articles with a date in the future are NOT built, so you can use this to schedule future publication, but only if the site is rebuilt at some point before that date. |
tags | Tags relevant to this post | Check first to choose from existing tags or add your own. Take care with typos not to create new ones unnecessarily. |
thumbnail | Optional image for the post | An image specified here will be used as the thumbnail for the post in list view, and as a banner across the top of the post in single view. It should exist in a corresponding directory assets/img/YYYY/YYYY-slug/ , so you need to create that directory and add that image file in your changes, in order to refer to it. A post should have either an image OR an icon, with the other field left blank |
icon | Optional icon for the post | Should be in format <icon-library> <icon-name> text-<colour> using the name of an icon from
FontAwesome icons
(filtered for “free” ones).<icon-library> can be either fa , fab or fas , shorthand for fa-regular , fa-brands or fa-solid .<icon-name> should be the name of the icon but witout the fa- prefix.text-<colour> is optional but the <colour> choice is from this site’s predefined theme colours, i.e.primary (default) secondary success danger warning info light dark . A post should have either an image OR an icon, with the other field left blank |
Once the rest of the content of the news item has been written, you’re at step 3 of the publishing process, so follow the remainder of the process to get the item published.
Markdown is very lightweight markup language for creating formatted text. It’s intended to be easy to read in its basic form, but the Hugo and Hinode systems used here add some additional functionality by using shortcodes and other features, which help specifically in the creation of richly-formatted static websites.
We want to keep the site looking smart, engaging and easy to read.
By using a well-maintained set of tools and taking care with authoring, reviewing and publishing content on the site, this is now more achievable than with previous platforms, using the tips and guidelines below.
markdownlint
markdown linter for VScode
example
shortcode)git
we have better control of the process
git
integrations to help with managing your changes to the site[markdown](#url)
format works too.link
documentation for examples."ceda_archive"
) in config/_default/params.toml
: consider adding to this list for frequently-used links: this means they can be used throughout the site but updated in one place if things change.data/abbr.yml
, for use with the
abbr
shortcode, for example
ceda
(hover for details).(see Hinode docs )
Hinode has some clever image-formatting features, see Hinode docs for details.
Store images for a news item post in assets/img/YYYY/YYYY-slug/
and choose one of them as the thumbnail. Others can be referred to in the text
using the image
shortcode, e.g.
{{< image src="img/flowers.jpg" ratio="3x2" caption="image caption" >}}
Note that although the image is stored below assets/img
, the path starts with img/
for the shortode. Add captions. Read the docs for why.
Use wrapper
classes to control the size & how the image is displayed.
Hugo supports Chroma syntax-highlighting of a huge list of languages , and Hinode provides shortcodes for some of these. Use the command-prompt or example shortcodes to render examples smartly,
export MY_VAR=123 # comment
command output
{{< command user="user" host="sci1" >}}
export MY_VAR=123 ## comment
(out)command output
{{< /command >}}
or use code blocks to apply syntax highlighting.
import something
print("hello world")
Use inline code
highlighting to show paths or filenames like /home/users/<username>
.
Some of these features are more suited to documentation (hence also using Hinode for the JASMIN Help Docs site), but if we’re including this sort of information in news items then these features help make it easier to read and more engaging as content.
"info"
"danger"
See the full set of Hinode formatting components for further ideas to brighten up content.
The table of contents shown in the right sidebar of this page is generated automatically from the headings in the markdown, but only for documents in the docs
section of the site (not currently linked in the navbar), as these section has a particular layout applied to it, see Hinode documentation on
Content Management
.
Similarly, the left sidebar navigation menu only appeats for the docs
section of the site. Its contents is controlled by the file data/docs.yml
, see
Cofiguration files are stored in…
The layouts
directory contains…