Skip to content

API: 1. Posts

David Elisma edited this page Aug 2, 2022 · 4 revisions

Front matter options available for pages and posts. Not all options are mandatory.

Mandatory elements

altLangPage

Link of translated web page without the site url (i.e. blog.canada.ca|blogue.canada.ca). Start with a /, lowercase, word separated with dashes (not spaces) and no special characters. When this option is declared the language toggle is present, otherwise it's hidden.

date

Date in ISO format of creation date of post

description

Will be used in meta name="description" and meta name="dcterm.description". Can't be empty, if not present the site description will be used. Page descriptions are between 100 and 320 characters.

title

Used for the title tag in the head, the h1 and the meta name="dcterms.title" tag. Page titles are between 10 and 60 characters.

Optional elements

author

Optional. meta name="dcterm.author" and meta name="dcterm.creator"

breadcrumbs

An array of a title and a link. Set by default in posts to Canada.ca > About Canada.ca > Canada.ca blog. Can be overriden in that format:

breadcrumbs:
 - title: [first page title]
   link: [first absolute url of page]
 - title: [second page title]
 	 link: [second absolute url of page]
 - ...

dateModified

Date in ISO format of last modification date of post

lang

Current language for the post. en and fr are the available options. Set by default to fr for all pages in the fr/ folder and to en for all pages in the en/ folder.

layout

Type of layout to use for the content. Available options:

  • core
  • default
  • fluid
  • post (set by default in the _post folder )
  • layout-home
  • layout-servermesssage
  • layout-splashpage
  • no-container
  • without-h1

pageclass

Allow to add a class to the body tag (set by default to cnt-wdth-lmtd in blog post)

pageType

To use when archived page are necessary.

subject

Comma-separated list of topics to fill meta name="dcterms.subject" tag

Images elements

Images are following a structured data approach and require 2 mandatory settings (alternative text and the image file name with its extension).

For complex images the long description could a 1. simple caption, 2. a more elaborate content that would be placed in an expand/collapse pattern or 3. both. We recommend option 2 as much as possible where you provide a short (65 characters) plain text for the summary field and the content part can accept rich content in HTML.

components/gc-simple-img.html

{% include components/gc-simple-img.html
     alt=""
     file=""
%}

components/gc-complex-img.html

{% include components/gc-complex-img.html
     alt="A long description can be found after the image."
     file=""
     caption=""
     summary=""
     content=""
%}