Blog-Doc

Some Hugo/Mainroad Theme documentation

How to separate Cut: #

<!--more-->

Text before this tag will appear in announce, but after in post body.

Code Blocks #

The source code with numbers

-> ```rust {linenos=true}
fn main() {
    println!("Hello, world!");
}
-> ```
1
2
3
fn main() {
    println!("Hello, world!");
}

without numbers

-> ```rust {linenos=false}
fmt.Println("Hello with numbers")
-> ```
fn main() {
    println!("Hello, world!");
}

Default without numbers

-> ```rust
fn main() {
    println!("Hello, world!");
}
-> ```
fn main() {
    println!("Hello, world!");
}

See themes\MainRoad\layouts_markup\render-codeblock.html

Link - Syntax highlighting.

Shortcuts #

tabpane #

{{< tabpane >}}
  {{< tab "Tab 1" >}}
    This is content for **tab 1**
  {{< /tab >}}
  {{< tab "Tab 2" "selected" >}}
    This is content for **tab 2**
  {{< /tab >}}
  {{< tab "Tab 3" >}}
    This is content for **tab 3**
  {{< /tab >}}
{{< /tabpane >}}
This is content for tab 1
This is content for tab 2
This is content for tab 3

Blockquotes #

Quote

Most human beings have an almost infinite capacity for taking things for granted.

> Quote

> [!INFO]
> Useful information that users should know, even when skimming content.
> 
> [!NOTE]
> Useful information that users should know, even when skimming content.

> [!TIP]
> Helpful advice for doing things better or more easily.

> [!IMPORTANT]
> Key information users need to know to achieve their goal.

> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.

> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.

Useful information that users should know, even when skimming content.



Useful information that users should know, even when skimming content.



Helpful advice for doing things better or more easily.



Key information users need to know to achieve their goal.



Advises about risks or negative outcomes of certain actions.



Urgent info that needs immediate user attention to avoid problems.

Icons in blog\themes\MainRoad\assets\icons

Colors blog\themes\MainRoad\assets\scss\components\_icon.scss

Colors blog\themes\MainRoad\assets\scss\components\_alert.scss

Inline Image #

This is an inline Alt text image.

Block Image #

Alt text

This is a [link](/doc/blog-doc/#shortcuts).

This is a link.

This is an [external link](https://github.com/).

This is an external link.

Tables #

| Month    | Amount |
| :------- | -----: |
| January  |    $10 |
| February |   $100 |
| March    |  $1000 |

Take a note about alignment.

MonthAmount
January$10
February$100
March$1000

accordion #

{{< accordion name="my-accordion" >}}
  {{< details summary="**Accordion 1**" open="true" >}}
    Lorem ipsum dolor sit amet.
  {{< /details >}}
  {{< details summary="**Accordion 2**" >}}
    Lorem ipsum dolor sit amet.
  {{< /details >}}
{{< /accordion >}}
Accordion 1

Lorem ipsum dolor sit amet.

Accordion 2

Lorem ipsum dolor sit amet.

alert #

{{< alert "success" >}}
  **Success:** This is a success alert.
{{< /alert >}}

{{< alert severity="warning" size="small" >}}
  **Warning:** This is a small warning alert.
{{</* /alert >}}

{{< alert hideIcon="true" >}}
  This alert doesn't have an icon.
{{</* /alert >}}
Success: This is a success alert.

Warning: This is a small warning alert.
This alert doesn’t have an icon.

blockquote #

{{< blockquote author="Aldous Huxley" cite="https://www.huxley.net/bnw/" caption="Brave New World" >}}
  Most human beings have an almost infinite capacity for taking things for granted.
{{< /blockquote >}}

Most human beings have an almost infinite capacity for taking things for granted.

—Aldous Huxley, Brave New World

button #

Button Primary Small Primary Primary Large Secondary Disabled

collapse #

{{< collapse "120" >}}
code
{{< /collapse >}}
1
2
3
4
5
6
7
8
9
10
{{< collapse "40" >}}
code
{{< /collapse >}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

The Expand appear only of the text not fit into collapsed area!


details #

{{< details summary="Summary" name="my-details" title="My Details" >}}
  Lorem ipsum dolor sit amet.
{{< /details >}}
Summary

Lorem ipsum dolor sit amet.


file-list #

icon #

ifparam #

The title param is not set

img #

Alt text Alt text

include #

_includes/file.md has been included

labeled-highlight #

users.json
1
2
3
4
5
6
[
  {
    "name": "John",
    "age": 30
  }
]
users.yaml
1
2
- name: John
  age: 30

param #

The page title is “Blog-Doc”

The page description is Documentation

tabpane #

This is content for tab 1
This is content for tab 2
This is content for tab 3

{{< carousel4 items="1" height="70" unit="%" >}}

Spoiler #

SpoilerLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
fn main() {
    println!("Hello, world!");
}

<details>
  <summary>Spoiler</summary>

Lorem ipsum dolor sit amet, ...

</details>