Static web pages are automatically generated every 10 minutes from Markdown files which you can edit directly on github.com.
You will need a github account with access to the project repository and familiarity with basic github operations. More on this in our separate github starter page.
Files ending with .md are in markdown format, a simple text-based notation to format the body of your document for the web. Most of the content of the site is encoded using markdown files as they are easy for non-developers to edit. Editors can ignore other types of files.
The Front-matter is an optional section at the beginning of the file used to define metadata associated with the document, like the title of the document or its authors. The Front matter starts and ends with a line consisting of three dashes (---).
Here's an example of a blog post in markdown:
---
title: Our first blog post
authors:
- jsmith
- jdoe
categories:
- blog
---
# Introduction
This is an example of a post written
by [KDL](https://kdl.kcl.ac.uk) in markdown...
Files ending with .html use the HTML5 standard instead of the simpler markdown language.
In both .html and .md files you may see some constructs surrounded by curly braces. They follow the Liquid notation, which is templating language to generate HTML or markdown from metadata. You can ignore it and leave its maintenance to the development team.
{% include 'team.md', team: 'research' %}
The .md and .html files correspond to individual web pages on the site and their location in the folder hierarchy match the web path of those pages.
For instance /about/team.md is the markdown file that will generate the web page at the URL /about/team . /about/index.md would map to the /about web page. And /index.html to the site home page, i.e. / .
You can find the blog posts and news articles under the /blogPostings folder. The team members are located under the /people folder.
In order to avoid redundant content, the metadata found in some markdown files like /people is reused across the site. For instance the author of a blog post only refers to the alias of a person. The web page for that post will automatically retrieve the full name of that person from their markdown file under /people.
There are two instances of the site: one is your public site and the
other a private staging site where content can be edited and preview
more freely. Each site uses a different branch in your github
repository: the live site is driven by the main
branch whereas the
staging site is driven by the staging
branch.
Whenever a file is modified on github the site will be republished automatically so you can preview your changes.
Let KDL know when you want to publish your staging content to your live site (what we call a release).
As an illustration, here's how you would edit the About page (/about):
- go to your repository on github and select the desired branch
(
main
is selected by default in the dropdown just above the file list) - browse down to /about
- click the index.md file
- you can see a basic preview of the body of the about page
- click the pencil icon on the right side of the toolbar just above the document
- use the simple text editor to edit the front matter and body of your document
- always preview your changes before committing them to ensure they don't disrupt the display
- add a short commit message summarising your change
- press 'commmit' to commit and push the change to the repository
- check on the live website after ~10 minutes
The slug of a web page is the name it take at the end of its URL. This also correspond to the name of the file.
A good slug:
- matches the title of the page (i.e. the title field in the front-matter)
- is made of letters, numbers and hyphens, please avoid any other character
- is short yet meaningful (eliding determinants is a common practice to keep thigns short)
- never changes after publication (as this would break links and bookmarks and confuse Google Search)
For instance, an article with he following title "Why we are ready to strike: a panel of workers respond" could have this slug "ready-to-strike-public-sector-workers".
The /posts folder contains one subdirectory for each main category of posts. Typically 'blog' and 'news'. The publication date of a post is determined by the date at the beginning of the file name, e.g. 2022-06-20-my-first-post.md
The part following the date is the slug.
By default all blog posts and news items are 'live'. To prevent an article from being listed on the site while you are drafting it, you can add the following key and value to its front-matter:
status: draft
Once the article is ready for publication, just remove that line or
change it to status: live
instead. You can preview the article on
the live site at any time by directly visiting its URL (see the above
section about 'slug').
Here is the full notation to include an image in your web page:
![ALT_TEXT]({{ "URL" | url }} "CAPTION"){.ALIGNMENT}
- ALT_TEXT: the alternative text, a short description of the image accessible to visually impaired people only
- URL: the relative address of the image file you have uploaded to the repository (typically under the assets/img folder)
- CAPTION: a short description of the image in the context of your article, this will be displayed below the image to all users
- ALIGNMENT: a class that spcify whether the image is aligned left {.media-left}, right {.media-right}, centre {.media-center} or full width {.media-full}
Here's an example:
![A 15th-century stone manor house]({{ "/assets/img/home/Hipswell-Hall-st.jpg" | url }} "Hipswell Hall, where Alice lived with her mother <br> © Suzanne Trill"){.media-left}
As illustrated above, you can use <br> in the caption to break lines.
TODO