note
Shortcode
note
shortcode is a Hugo-only feature to quickly create the Bissetii's note
component. This allows content creators to focus on writing the contents instead
of rendering HTML here and there. By default, the shortcode renders the content
as markdown. If HTML is detected, the shortcode will switch the rendering to
safe HTML instead.
Example usage:
|
|
This shortcode is available starting from v1.12.1
.
Heads-Up
While the shortcode is useful, it breaks the Markdown syntax conventions due to Hugo specific shortcode feature. Therefore, when using other Markdown renderer, these shortcodes would be rendered as text instead of HTML code fragments.
Also, be careful and stay safe while using this shortcode. It allows any form of HTML to be embedded into your Markdown page.
Using note
{{< note <type> <title> >}}
<content>
{{< /note >}}
note
uses both parameters and content as its input methods. For parameters,
note
shortcode accepts the following in strict order:
<type>
- the type of notes. See Note Component for available types.<title>
- the title of the note. It is bolded by default.
As for <content>
inside the shortcode wrapper, you MUST decide either to
write as strictly Markdown format or strictly HTML format but
not both simultenously.
The shortcode will first render the <content>
as Markdown format.
Should it detects any HTML codes, it will automatically switch to safeHTML
format rendering instead.
The shortcode will render the output accordingly and seamlessly to its output types automatically (example: vanilla HTML for normal HTML output; AMP HTML for AMP output).
Example
Since this is a HTML renderer in Markdown file, you want to call in the
shortcode using the <
symbol instead of %
. The brackets are as follow:
|
|
This will render the output as:
|
|
Conclusion
That’s all about note
shortcode in Bissetii. If you need more feature or
need to report a bug, please feel free to file an issue at our
Issue Section.