This page looks best with JavaScript enabled

Markdown Syntax Guide

 ·  ☕ 2 min read  ·  🤖 TED LZY

This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.

Headings

The following HTML <h1><h6> elements represent six levels of section headings. <h1> is the highest section level while <h6> is the lowest.

H1

H2

H3

H4

H5
H6

Paragraph

This is the first paragraph.

Now this is the second paragraph.

Blockquotes

The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a footer or cite element, and optionally with in-line changes such as annotations and abbreviations.

Blockquote without attribution

Note that you can use Markdown syntax within a blockquote.

Blockquote with attribution

Don’t communicate by sharing memory, share memory by communicating.


Rob Pike1

Tables

Tables aren’t part of the core Markdown spec, but some platform supports them out-of-the-box. Like in this HUGO platform.

Name Age
Bob 27
Alice 23

Inline Markdown within tables

Inline    Markdown    In    Table
italics bold strikethrough    code

Code Blocks

Code block with backticks, programming language can be specified after the backticks

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example HTML5 Document</title>
</head>
<body>
  <p>Test</p>
</body>
</html>

Code block indented with four spaces

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example HTML5 Document</title>
</head>
<body>
  <p>Test</p>
</body>
</html>

Code block with Hugo’s internal highlight shortcode

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example HTML5 Document</title>
</head>
<body>
  <p>Test</p>
</body>
</html>

List Types

Ordered List

  1. First item
  2. Second item
  3. Third item

Unordered List

  • List item

  • Another item

  • And another item

  • List item

    • Secondary list item with more than 2 space in front

Nested list

  • Item
  1. First Sub-item
  2. Second Sub-item

Other Elements — abbr, sub, sup, kbd, mark

GIF is a bitmap image format.

H2O

Xn + Yn: Zn

Press CTRL+ALT+Delete to end the session.

The highlighter is useful in many cases.


  1. The above quote is excerpted from Rob Pike’s talk during Gopherfest, November 18, 2015. ↩︎

Share on

TED LZY
WRITTEN BY
TED LZY
Programmer