Practical Markdown tips for Hugo and general writing
Created:March 6, 2019
4 min read
Table of Contents
Principles & Quick Tips โ
Use two trailing spaces at the end of a line for a hard line break when you want a new line within the same paragraph.
A blank line creates a paragraph break (a visible empty line in the rendered output).
Prefer bold for small section highlights or inline emphasis when you want the text to stand out.
Keep headings shallowโavoid more than three levels (H1, H2, H3) for most articles.
Always add a blank line before a table or a code block to ensure proper rendering.
Use numbered lists only when items are short and contiguous. If each item needs a long explanation, use manual numbers or bold headings for each section instead of relying on automatic incremental numbering.
Line breaks & paragraphs ๐ง
Hard line break (same paragraph):
This is a line with two spaces at the end.
This will render on the next line but in the same paragraph.
Alternative hard break using HTML:
Line one<br>
Line two
Paragraph break (new paragraph):
This is the first paragraph.
This is a new paragraph (visible gap above).
Headings & structure ๐๏ธ
Use H1 for the page title (Hugo handles this via frontmatter). For content, prefer H2 and H3.
Avoid deep nesting; if you need more than three heading levels, consider splitting to a separate page or using subsections within docs.
Example:
## Section (H2)
### Subsection (H3)
Emphasis & small headings โจ
Italic: *italic* or _italic_
Bold: **bold** or __bold__
Inline code: `code`
Tip: Use bold to create short inline headings inside sections when you don’t want an extra header line.
Lists โ ordered & unordered โ
Unordered list:
- Item one
- Item two
- Subitem
Ordered list (automatic):
1. First
2. Second
3. Third
When list items require long paragraphs between them, don’t rely on automatic numbering. Instead use manual numbers / bold headings:
**1. First item**
Long explanation for the first item...
**2. Second item**Long explanation for the second item...
Comments