Post Options (post
)
Defines optional settings for overriding site configuration on a blog post using values in the post’s front matter.
JSON Schema
Definition
{
"$id": "https://platen.io/schemas/platen/content/post/schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Optional settings for overriding site configuration on a blog post.\n\nhttps://platen.io/schemas/platen/content/post/",
"properties": {
"enable_comments": {
"description": "Whether to enable comments on the page\n\nhttps://platen.io/schemas/platen/content/post/#enable_comments",
"title": "Enable Comments",
"type": "boolean"
},
"exclude_from_search": {
"description": "Whether to exclude the page from site search results\n\nhttps://platen.io/schemas/platen/content/post/#exclude_from_search",
"title": "Exclude from Search",
"type": "boolean"
},
"extra_classes": {
"description": "A list of classes to inject to the post's body element\n\nhttps://platen.io/schemas/platen/content/post/#extra_classes",
"items": {
"type": "string"
},
"title": "Extra CSS Classes",
"type": "array",
"uniqueItems": true
},
"markup": {
"description": "Control markup-specific behavior for this page, overriding site-level defaults.\n\nhttps://platen.io/schemas/platen/content/post/#markup",
"properties": {
"katex": {
"$ref": "https://platen.io/schemas/platen/content/markup/katex/schema.json"
},
"mermaid": {
"$ref": "https://platen.io/schemas/platen/content/markup/mermaid/schema.json"
}
},
"title": "Markup Options",
"type": "object"
},
"table_of_contents": {
"description": "Overrides the site's table of contents configuration for this page.\n\nhttps://platen.io/schemas/platen/content/post/#table_of_contents",
"properties": {
"maximum_level": {
"default": 4,
"description": "Specify the maximum heading level to include in the page's table of contents.\n\nhttps://platen.io/schemas/platen/content/post/#maximum_level",
"maximum": 6,
"minimum": 1,
"title": "Maximum Heading Level",
"type": "integer"
},
"minimum_level": {
"default": 2,
"description": "Specify the minimum heading level to include in the page's table of contents.\n\nhttps://platen.io/schemas/platen/content/post/#minimum_level",
"maximum": 6,
"minimum": 1,
"title": "Minimum Heading Level",
"type": "integer"
},
"ordered_list": {
"default": false,
"description": "Specify whether table of contents entries should render in an ordered list.\n\nhttps://platen.io/schemas/platen/content/post/#ordered_list",
"title": "As Ordered List",
"type": "boolean"
},
"render": {
"default": false,
"description": "Whether to render the table of contents for the page\n\nhttps://platen.io/schemas/platen/content/post/#render",
"title": "Render the Table of Contents",
"type": "boolean"
},
"use_built_in": {
"default": false,
"description": "Choose whether to use Hugo's builtin table of contents.\n\nhttps://platen.io/schemas/platen/content/post/#use_built_in",
"title": "Use Built-In",
"type": "boolean"
}
},
"title": "Table of Contents",
"type": "object"
},
"title_as_heading": {
"default": false,
"description": "Specify whether the page title should be rendered as an h1 instead of strong.\n\nhttps://platen.io/schemas/platen/content/post/#title_as_heading",
"title": "Render Page Title as Heading",
"type": "boolean"
}
},
"title": "Post Options",
"type": "object"
}
Render Page Title as Heading (title_as_heading
)
Use this setting to specify whether the page title should be rendered as an <h1>
element instead of the default <strong>
element.
If this set to true
, Platen renders the title text in an <h1>
with the ID set to
the title, downcased and urlized.
When the page title is rendered as a heading, it’s always visible, even when not in mobile view.
Enable Comments (enable_comments
)
Specifies whether to enable comments on the page.
Exclude from Search (exclude_from_search
)
Specifies whether to exclude the page from site search results.
Extra CSS Classes (extra_classes
)
Specifies a list of CSS classes to add to the post’s body
element. This enables you to add
styling to an entire post quickly without editing your theme.
The classes specified by this option are combined with those added by the site’s
display.section_classes
setting for this post.
Table of Contents (table_of_contents
)
Defines overrides the site’s table of contents configuration for this page.
Use Built-In (use_built_in
)
Choose whether to use Hugo’s builtin table of contents or generate them with Platen,
overriding the site’s configuration for this page. This overrides the site’s
display.table_of_contents.use_built_in
setting.
Hugo’s builtin table of contents only includes markdown headings, not HTML headings added in shortcodes.
Platen’s table of contents includes all headings, HTML and Markdown, as long as they’re
within the specified values for minimum_level
and
maximum_level
, inclusive.
Render the Table of Contents (render
)
Specifies whether to render the table of contents for the page. This setting overrides
the site’s display.table_of_contents.Render
, if set.
To prevent the table of contents from rendering for a page, set this value to false
.
To render the table of contents for a page when it’s disabled at the site level, set
this value to true
.
Minimum Heading Level (minimum_level
)
Specify the minimum heading level to include in the page’s table of contents, overriding
the site’s display.table_of_contents.minimum_level
setting. This value
only affects the table of contents when use_built_in
is set to false
.
Headings at a lower level than this value aren’t included in the table of contents. For
example, when this is set to 3
, first and second level Markdown and HTML headings
aren’t included in the table of contents.
This value must be less than or equal to the value of maximum_level
.
Maximum Heading Level (maximum_level
)
Specify the maximum heading level to include in the page’s table of contents, overriding
the site’s display.table_of_contents.maximum_level
setting. This value
only affects the table of contents when use_built_in
is set to false
.
Headings at a higher level than this value aren’t included in the table of contents. For
example, when this is set to 4
, fifth and sixth level Markdown and HTML headings
aren’t included in the table of contents.
This value must be greater than or equal to the value of minimum_level
.
As Ordered List (ordered_list
)
Specify whether the table of contents should render its entries in an ordered list with numerals before each item. By default, the table of contents is rendered in an unordered list without any list markers, only with indents.
Set this value to true
to add the entries in an ordered list instead.
This value overrides display.table_of_contents.ordered_list
in the site’s
configuration.
Markup Options (markup
)
Specifies a map of options for Platen’s markup, allowing you to override site-level defaults for a markup on a per-page basis.
KaTeX Options (katex
)
Defines optional settings for overriding site configuration for the KaTeX markup option,
which enables you to use KaTeX markup in your content with an image link (that has
the chem:
, katex:
, or math:
prefix), codeblock (whose language ID is chem
,
katex
, and math
), and even with KaTeX’s own open/closing tags in normal Markdown content if
always_load
is set to true
.
With KaTeX, you can write mathematical and chemical formulae in plaintext and render them as beautiful formula on your site.
For more information, see KaTeX Options
Mermaid Options (mermaid
)
Defines optional settings for overriding site configuration for the Mermaid diagrams
markup, which enables you to use Mermaid to create diagrams in your content with mermaid
codeblock rendering hook.
With Mermaid, you can create numerous diagrams including flowcharts, pie charts, and sequence diagrams.
For more information, see Mermaid Options