From 9bb7f8c78598f96900b612c7ed64cad56981c946 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Wed, 15 Nov 2023 13:05:28 -0800 Subject: [PATCH] Include RenderString example for emoji shortcodes --- content/en/quick-reference/emojis.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/content/en/quick-reference/emojis.md b/content/en/quick-reference/emojis.md index 035d0490c..98683ee60 100644 --- a/content/en/quick-reference/emojis.md +++ b/content/en/quick-reference/emojis.md @@ -1,7 +1,7 @@ --- title: Emoji quick reference guide linkTitle: Emojis -description: Include emoji shortcodes in your markdown, or use the emojify function in your templates. +description: Include emoji shortcodes in your markdown or templates. categories: [quick reference] keywords: [emoji] menu: @@ -12,6 +12,12 @@ weight: 40 toc: true --- +Configure Hugo to enable emoji processing in markdown: + +{{< code-toggle file=hugo >}} +enableEmoji = true +{{< /code-toggle >}} + With emoji processing enabled, this markdown: ```md @@ -26,15 +32,14 @@ Hello! 👋 And in your browser... Hello! :wave: -To enable this capability in your site configuration: +To process an emoji shortcode from within a template, use the [`emojify`] function or pass the string through the [`RenderString`] method on a `Page` object: -{{< code-toggle file=hugo >}} -enableEmoji = true -{{< /code-toggle >}} - -To process an emoji shortcode from within a template, use the [`emojify`] function. +```go-html-template +{{ "Hello! :wave:" | .RenderString }} +``` [`emojify`]: /functions/transform/emojify +[`RenderString`]: /methods/page/renderstring ## Introduction