Skip to content

Creating A News Post

Andrew Berezovskyi edited this page Sep 3, 2019 · 5 revisions

How to Create a News / Blog Post on the OSLC Site

  1. Firstly, clone the 'OSLC/oslc-site-hugo' repository.
  2. Create the markdown file for your post. Name the file with something meaningful, but not too long. Uses dashes to separate words, and use lowercase for all characters in the name.

There are 2 ways to create the file:

  • copy an existing post (in the 'content/news' folder) and change the information in the post. This means changing the value of the metadata fields, and replacing the content with the content of the new post.

OR

  • From the repository root, type 'hugo new news/filename.md' replacing filename with the name of the post. The new file will be in the 'content/news' folder.
  1. It is recommended to add an image or images to your post. This can be done by adding the 'figure syntax'.

Example:

{{< figure src="/img/blog/pdteurope.jpg" class="small" title="Brian King speaking about the Data Web" >}}

Be sure the add the image to the repository in the 'static/img' folder.

  1. Once you are satisfied the post is ready, create the pull request with your changes for review.

Post Metadata

  • categories - a comma separated list of categories that the post falls into, each one in double quotes
  • date - the date of the post
  • author - Name of the post autor
  • author_uri - a url to a page of the author. This can be their homepage, linkedin profile, or similar.
  • tags - a comma separated list of tags for the post, each one in double quotes. 'external'-tagged entries must be published as headless leaf bundles
  • title - The title of the blog post
  • banner - a relative path to the image associated with the post. This image will appear on the News index page in the post preview, as well as at the top of the blog post.
  • url - a relative url of where the post will appear on the site. It should always be in the news section, this starting with 'news/'. The second part of the path should mirror the file name, but they do not need to always match exactly
  • summary - a short blurb on the post, max 2 short sentences