Skip to main content

Emoji Support in Hugo

·151 words·1 min·
Chris Gillatt
Author
Chris Gillatt
Cloud/Systems Engineer with an addiction to coffee, tech and writing.
Table of Contents
Hugo Configuration - This article is part of a series.
Part 2: This Article

Emoji can be enabled in a Hugo site in a couple of different of ways.

The emojify function can be called directly in templates or Inline Shortcodes.

To enable emoji globally, set enableEmoji to true in your site’s configuration

In this blog’s theme, the following line is simply added to the config.toml:

enableEmoji = true

Then you can type emoji shorthand codes directly in content files; e.g.

🙈 :see_no_evil: 🙉 :hear_no_evil: 🙊 :speak_no_evil:

Tip 🚀
#

The Emoji cheat sheet hosted at https://www.webfx.com/tools/emoji-cheat-sheet is a great reference for emoji shortcodes:


N.B. The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g.

.emoji {
font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols;
}
Hugo Configuration - This article is part of a series.
Part 2: This Article