Theme template variables
At page render time, a number of variables are exposed to the theme with information relating to the rendering. This is how the theme can know, for example, to render a post list or a post display page or any other combination.
Variables present on all renders
| Name | Type | Description |
|---|---|---|
| ssg_site_title | String | Title as defined in site configuration |
| ssg_site_subtitle | String | Subtitle as defined in site configuration |
| ssg_title | String | Title of the page being rendered |
| ssg_content | String | Rendered markdown as HTML representing the content of the page |
| ssg_page_type | String | Indicates type of page being rendered. Can be “generic” for a simple page, “post” for a post (requiring date and tags rendering extra), or “post_list” for a postlist. |
| ssg_site_baseurl | String | Base URL Defined in site configuration |
| ssg_page_path | String | Path to the page that is currently being rendered. Can be useful for certain analytics tools. |
| nav_links | Array | Links for the navigation bar. Element 0 is the text for the link, Element 1 is the link itself. |
| ssg_site_posts | Array | Array of all posts on the site. When rendering a postlist for a specific tag or post type, this will only contain the posts for that. |
Variables only present on post page renders
| Name | Type | Description |
|---|---|---|
| ssg_post_date | String | Date the post was created, pre-transformed into a string. |
| ssg_post_tags | Array | List of the tags the post has assigned. |
| ssg_post_meta | Hash | User defined data on a post. Can be used to store extra information, e.g. a featured image. |
Custom Post Type variables
| Name | page_type | Type | Description |
|---|---|---|---|
| ssg_post_type | post | String | Name of the post type being used by the post. Can be used to render the post page differently for custom post types |
| ssg_post_type | post_list | String | Name of the post type being listed |