Add post

This page helps to generate posts in the correct format for the website.

Help

✏️ How to add a new post

  1. Open each section under the 'Set post content' heading and enter the information. If you know you don't need a specific field, just leave it blank.
  2. After you've completed the desired fields under 'Set post content':
    • Open the '1. Open GitHub' section. It contains a button that will open the correct page on GitHub.
    • Open the '2. Set a file name' section. If you have completed the earlier information correctly, a suggested file name can be generated by selecting 'Generate'. You can override this manually by editing the text field. Copy and paste the content of the text field into the 'Name your file...' field of the GitHub website.
    • Open the '3. Copy post content' section. Use the 'Copy content to clipboard' button to copy the post content to your clipboard. Paste (Ctrl + V or ⌘ + V) into the “Edit new file” text box on the GitHub page.
    • Select “Commit new file” on the GitHub page.

The post will usually take up to 5 minutes to appear. You will usually receive an email if there is an error.

🎨 Formatting and styles

Most formatting, like page layouts, is done automatically for you when the site is generated.

You can format the “body text” of your post using Markdown syntax.

📸 Uploading images

This tool does not allow you to upload images directly. Instead, you have to upload them to GitHub and then include Markdown to refer to them.

If you need to include an image as part of your post, first you will need to upload the image to the image store.

Then, if you want to display the image:

  1. at the very start of a post, enter the URL for the image in this tool's “post hero image” field
  2. in the body of a post, in the “body text” textarea include the URL for the image in Markdown format like this:
    ![image description](imageURL)

🗂 Uploading files

This tool does not allow you to upload files directly. Instead, you have to upload them to GitHub and then include Markdown to refer to them.

If you need to include a file as part of your post, you will need to:

  1. upload the file to the document store
  2. in the body of a post, in the “body text” textarea include the URL for the image in Markdown format like this:
    [text to display](fileURL)

📄 File names

All post file names should end in .md, .markdown. Users who are confident in HTML coding can produce more complex pages and end their file names in .html.

Some file names have a date at the start or the posts won't show up.

  • For news, publications, consultations, and notices, file names must start with a date in the format YYYY-MM-DD-.
  • For events, file names must not start with a date but instead should be put in nested folders in the format /YYYY/MM/DD/.
  • All other posts do not require a date in the file name, but this can be helpful for forcing a specific order.

🔐 GitHub permissions

You will require a GitHub account and relevant permissions to the repository for this site in order to add or amend its content.

Set post content

Choose a collection

Which part of the site will this post appear on?

For example – if it's a blog post, it would go in the 'News' collection.

Choose a post format

What format of post will this be?

This is almost always the same as the Collection, but you can change this setting to override the format if you need to use a different format for some reason.

For example – if it's an event, choose 'Event format'.

Add a title and excerpt

Add topics (optional)

Used to generate topic pages.

If a post is tagged with a topic, it will show up on the corresponding topic page. One or more items in a comma separated list.

For example – "Topic 1", "Topic 2", "Topic 3"

Set the author (optional)

Makes the author's name a link in some templates. You could link to a profile on the website or a social media profile.

For example – https://www.twitter.com/cslgbt

Set publish date

On what date is the post meant to be published?

For example – 2021 12 31

Add hero images and videos (optional)

Sets the hero image for the post.

Must be an image file already uploaded to the website (you can't upload images through this tool).

For example – https://www.civilservice.lgbt/name-of-image.png

Shows a video at the top of the post.

Must be a YouTube URL.

For example – https://www.youtube.com/embed/ZQtfWH89gjQ

Set a permalink

The permalink is the part of the web address that appears after www.civilservice.lgbt.

Permalinks usually start with the name of the collection, followed by the date, followed by the title of the post. For example – /news/2021/12/31/happy-new-year.

Permalinks are generated automatically depending on which folder you put them in, but you can override them to change this to something easier to remember.

You can only have one permalink. If you need a different web address to redirect to the same page, use the “Redirect from” field below.

Set up any redirects (optional)

Use this to redirect from another page to this page. Enter one url only.

For example – /2021/12/31/name-of-your-post/

Use this to redirect to another URL from this page. Enter one url only.

For example – /2021/12/31/name-of-your-post/

Add the post content

Publish the post

1. Open GitHub

2. Set a file name

3. Copy post content

4. Publish the post

Preview

1970-01-01-post-preview.md
A preview of your output will display here shortly.

Only an excerpt of the output will be displayed.