Creating a new theme

15FrrsWKvg9egID9Gd0IHzhudR9LqKVh3.jpg

Emoji can be enabled in a Hugo project in a number 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 and then you can type emoji shorthand codes directly in content files; e.g.

πŸ™ˆ :see_no_evil: πŸ™‰ :hear_no_evil: πŸ™Š :speak_no_evil:

The Emoji cheat sheet is a useful reference for emoji shorthand codes.

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.

Inline CSS

 1<style>
 2 .emojify {
 3     font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols;
 4     font-size: 2rem;
 5     vertical-align: middle;
 6   }
 7   @media screen and (max-width:650px) {
 8     .nowrap {
 9       display: block;
10      margin: 25px 0;
11    }
12  }
13</style>

Javascript

 1function createEl(element) {
 2  return document.createElement(element);
 3}
 4
 5function elem(selector, parent = document){
 6  let elem = parent.querySelector(selector);
 7  return elem != false ? elem : false;
 8}
 9
10let navBar = elem(`.${bar}`);
11let nav = elem('.nav-body');
12let open = 'nav-open';
13let exit = 'nav-exit';
14let drop = 'nav-drop';
15let pop = 'nav-pop';
16let navDrop = elem(`.${drop}`);
17let hidden = 'hidden';

Swift

 1class Person {
 2  var residence: Residence?
 3}
 4
 5class Residence {
 6  var rooms = [Room]()
 7  var numberOfRooms: Int {
 8    return rooms.count
 9  }
10
11
12
13  subscript(i: Int) -> Room {
14    get {
15      return rooms[i]
16    }
17    set {
18      rooms[i] = newValue
19    }
20  }
21
22
23  func printNumberOfRooms() {
24    print("The number of rooms is \(numberOfRooms)")
25  }
26
27  var address: Address?
28
29}
30
31        
The Latest