site

personal website, served at mordaunt.dev/site
Log | Files | Refs

markdown-syntax.md (4272B)


      1 +++
      2 authors = ["Lone Coder"]
      3 title = "Markdown Syntax Guide"
      4 date = "2023-07-13"
      5 description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements."
      6 tags = [
      7     "hugo",
      8     "markdown",
      9     "css",
     10     "html",
     11 ]
     12 categories = [
     13     "theme demo",
     14     "syntax",
     15 ]
     16 series = ["Theme Demo"]
     17 aliases = ["migrate-from-jekyl"]
     18 +++
     19 
     20 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.
     21 
     22 <!--more-->
     23 
     24 ## Headings
     25 
     26 The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.
     27 
     28 # H1
     29 
     30 ## H2
     31 
     32 ### H3
     33 
     34 #### H4
     35 
     36 ##### H5
     37 
     38 ###### H6
     39 
     40 ## Paragraph
     41 
     42 Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.
     43 
     44 Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
     45 
     46 ## Links
     47 
     48 This is a [internal link](/posts/emoji-support) to another page. [This one](https://www.gohugo.io) points to a external page nad will be open in a new tag.
     49 
     50 ## Blockquotes
     51 
     52 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.
     53 
     54 #### Blockquote without attribution
     55 
     56 > Tiam, ad mint andaepu dandae nostion secatur sequo quae.
     57 > **Note** that you can use _Markdown syntax_ within a blockquote.
     58 
     59 #### Blockquote with attribution
     60 
     61 > Don't communicate by sharing memory, share memory by communicating.<br>
     62 > — <cite>Rob Pike[^1]</cite>
     63 
     64 ## Tables
     65 
     66 Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-box.
     67 
     68 | Name  | Age |
     69 | ----- | --- |
     70 | Bob   | 27  |
     71 | Alice | 23  |
     72 
     73 #### Inline Markdown within tables
     74 
     75 | Italics   | Bold     | Code   |
     76 | --------- | -------- | ------ |
     77 | _italics_ | **bold** | `code` |
     78 
     79 ## Code Blocks
     80 
     81 #### Code block with backticks
     82 
     83 ```html
     84 <!DOCTYPE html>
     85 <html lang="en">
     86     <head>
     87         <meta charset="utf-8" />
     88         <title>Example HTML5 Document</title>
     89     </head>
     90     <body>
     91         <p>Test</p>
     92     </body>
     93 </html>
     94 ```
     95 
     96 #### Code block indented with four spaces
     97 
     98     <!doctype html>
     99     <html lang="en">
    100     <head>
    101       <meta charset="utf-8">
    102       <title>Example HTML5 Document</title>
    103     </head>
    104     <body>
    105       <p>Test</p>
    106     </body>
    107     </html>
    108 
    109 #### Code block with Hugo's internal highlight shortcode
    110 
    111 {{< highlight html >}}
    112 
    113 <!doctype html>
    114 <html lang="en">
    115 <head>
    116   <meta charset="utf-8">
    117   <title>Example HTML5 Document</title>
    118 </head>
    119 <body>
    120   <p>Test</p>
    121 </body>
    122 </html>
    123 {{< /highlight >}}
    124 
    125 ## List Types
    126 
    127 #### Ordered List
    128 
    129 1. First item
    130 2. Second item
    131 3. Third item
    132 
    133 #### Unordered List
    134 
    135 -   List item
    136 -   Another item
    137 -   And another item
    138 
    139 #### Nested list
    140 
    141 -   Fruit
    142     -   Apple
    143     -   Orange
    144     -   Banana
    145 -   Dairy
    146     -   Milk
    147     -   Cheese
    148 
    149 #### Foot Notes
    150 
    151 Check it[^2] at the end[^3] of this text[^4].
    152 
    153 ## Other Elements — abbr, sub, sup, kbd, mark
    154 
    155 <abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
    156 
    157 H<sub>2</sub>O
    158 
    159 X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
    160 
    161 Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.
    162 
    163 Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
    164 
    165 [^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
    166 [^2]: A footnote.
    167 [^3]: Another one.
    168 [^4]: Cool, right?