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.
๐๐๐๐๐๐
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.
1
2
3
.emoji {
font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols;
}
Rich Content
Hugo ships with several Built-in Shortcodes for rich content, along with a Privacy Config and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds.
Math Typesetting
We need goldmark katex entension which is not yet we have:
[https://github.com/gohugoio/hugo/issues/6544](https://github.com/gohugoio/hugo/issues/6544)
Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.
*** /path/to/original ''timestamp''
--- /path/to/new ''timestamp''
***************
*** 1 ****
! This is a line.
--- 1 ---
! This is a replacement line.
It is important to spell
-removed line
+new line
*** /path/to/original ''timestamp''
--- /path/to/new ''timestamp''
***************
*** 1 ****
! This is a line.
--- 1 ---
! This is a replacement line.
It is important to spell
-removed line
+new line
importjavax.swing.JFrame;//Importing class JFrame
importjavax.swing.JLabel;//Importing class JLabel
publicclassHelloWorld{publicstaticvoidmain(String[]args){JFrameframe=newJFrame();//Creating frame
frame.setTitle("Hi!");//Setting title frame
frame.add(newJLabel("Hello, world!"));//Adding text to frame
frame.pack();//Setting size to smallest
frame.setLocationRelativeTo(null);//Centering frame
frame.setVisible(true);//Showing frame
}}
import{x,y}aspfrom'point';constANSWER=42;classCarextendsVehicle{constructor(speed,cost){super(speed);varc=Symbol('cost');this[c]=cost;this.intro=`This is a car runs at
${speed}.`;}}for(letnumof[1,2,3]){console.log(num+0b111110111);}function$initHighlight(block,flags){try{if(block.className.search(/\bno\-highlight\b/)!=-1)returnprocessBlock(block.function,true,0x0F)+' class=""';}catch(e){/* handle exception */vare4x=<div>Example<p>1234</p></div>;}for(vari=0/2;i<classes.length;i++){// "0 / 2" should not be parsed as regexp
if(checkCondition(classes[i])===undefined)return/\d+[\s/]/g;}console.log(Array.every(classes,Boolean));}export$initHighlight;
/*********************************************************
* General
*/pre[class*="language-"],code{color:#5c6e74;font-size:13px;text-shadow:none;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;line-height:1.5;tab-size:4;hyphens:none;}pre[class*="language-"]::selection,code::selection{text-shadow:none;background:#b3d4fc;}@mediaprint{pre[class*="language-"],code{text-shadow:none;}}pre[class*="language-"]{padding:1em;margin:.5em0;overflow:auto;background:#f8f5ec;}:not(pre)>code{padding:.1em.3em;border-radius:.3em;color:#db4c69;background:#f9f2f4;}
Shortcodes
Markdownify box
This is boxmd shortcode
Simple box
This is **box** shortcode
Code tabs
Make it easy to switch between different code
1
System.out.println('HelloWorld!');
1
console.log('Hello World!');
Tabs for general purpose
#### Windows section
```javascript
console.log('Hello World!');
```
โ ๏ธBecareful that the content in the tab should be different from each other. The tab makes unique id hashes depending on the tab contents. So, If you just copy-paste the tabs with multiple times, since it has the same contents, the tab will not work.
st=>start: Start|past:>http://www.google.com[blank]
e=>end: End|future:>http://www.google.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes
or No?|approved:>http://www.google.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|future
st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e
JS Sequence Diagram Test
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!
Title: Here is a title
A->B: Normal line
B-->C: Dashed line
C->>D: Open arrow
D-->>A: Dashed open arrow
Mermaid Test
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
sequenceDiagram
participant Alice
participant Bob
Alice->John: Hello John, how are you?
loop Healthcheck
John->John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail...
John-->Alice: Great!
John->Bob: How about you?
Bob-->John: Jolly good!
graph TD
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
gantt
section Section
Completed :done, des1, 2014-01-06,2014-01-08
Active :active, des2, 2014-01-07, 3d
Parallel 1 : des3, after des1, 1d
Parallel 2 : des4, after des1, 1d
Parallel 3 : des5, after des3, 1d
Parallel 4 : des6, after des4, 1d
classDiagram
Class01 <|-- AveryLongClass : Cool
<<interface>> Class01
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
class Class10 {
<<service>>
int id
size()
}
stateDiagram
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]