From 75e8e1eea45ed3b879e234f8d2b71d06799f6603 Mon Sep 17 00:00:00 2001 From: magikstm Date: Fri, 25 Nov 2022 03:48:48 -0500 Subject: [PATCH] Update Shortcodes doc to add details on Macros for templates --- docs/content/documentation/content/shortcodes.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/content/documentation/content/shortcodes.md b/docs/content/documentation/content/shortcodes.md index 953b319ce5..a5130e97f3 100644 --- a/docs/content/documentation/content/shortcodes.md +++ b/docs/content/documentation/content/shortcodes.md @@ -5,8 +5,7 @@ weight = 40 Zola borrows the concept of [shortcodes](https://codex.wordpress.org/Shortcode_API) from WordPress. In our case, a shortcode corresponds to a template defined in the `templates/shortcodes` directory or -a built-in one that can be used in a Markdown file. If you want to use something similar to shortcodes in your templates, -try [Tera macros](https://tera.netlify.com/docs#macros). +a built-in one that can be used in a Markdown file. Broadly speaking, Zola's shortcodes cover two distinct use cases: @@ -18,6 +17,8 @@ The latter may also be solved by writing HTML, however Zola allows the use of Ma rather than `.html`. This may be particularly useful if you want to include headings generated by the shortcode in the [table of contents](@/documentation/content/table-of-contents.md). +If you want to use something similar to shortcodes in your templates, you can use [Tera macros](https://tera.netlify.com/docs#macros). They are functions or components that you can call to return some text. + ## Writing a shortcode Let's write a shortcode to embed YouTube videos as an example. In a file called `youtube.html` in the `templates/shortcodes` directory, paste the