mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 20:17:17 +00:00
Include RenderString example for emoji shortcodes
This commit is contained in:
1 parent
783fdd3ac3
commit
9bb7f8c785
1 file changed
+12
-7
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: Emoji quick reference guide
|
title: Emoji quick reference guide
|
||||||
linkTitle: Emojis
|
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]
|
categories: [quick reference]
|
||||||
keywords: [emoji]
|
keywords: [emoji]
|
||||||
menu:
|
menu:
|
||||||
@@ -12,6 +12,12 @@ weight: 40
|
|||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Configure Hugo to enable emoji processing in markdown:
|
||||||
|
|
||||||
|
{{< code-toggle file=hugo >}}
|
||||||
|
enableEmoji = true
|
||||||
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
With emoji processing enabled, this markdown:
|
With emoji processing enabled, this markdown:
|
||||||
|
|
||||||
```md
|
```md
|
||||||
@@ -26,15 +32,14 @@ Hello! 👋
|
|||||||
|
|
||||||
And in your browser... Hello! :wave:
|
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 >}}
|
```go-html-template
|
||||||
enableEmoji = true
|
{{ "Hello! :wave:" | .RenderString }}
|
||||||
{{< /code-toggle >}}
|
```
|
||||||
|
|
||||||
To process an emoji shortcode from within a template, use the [`emojify`] function.
|
|
||||||
|
|
||||||
[`emojify`]: /functions/transform/emojify
|
[`emojify`]: /functions/transform/emojify
|
||||||
|
[`RenderString`]: /methods/page/renderstring
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user