Chiawei Chen

Site Editing Cheatsheet

2023-01-26


math mode

math: true

enable \(\KaTeX\) block on page, powered by KaTeX.js

syntax

inline mode

The quadratic polynomial \\(ax^2 + bx + c \\) has discriminant \\(b^2 - 4 a c\\).

will produce

The quadratic polynomial \(ax^2 + bx + c \) has discriminant \(b^2 - 4 a c\).

display mode

achieved this by katex shortcode .

{{< katex >}}
x_{1,2} = \frac{ - b \pm \sqrt{b^2 - 4ac} }{ 2a }
{{< /katex >}}

will produce

The quadratic formula for the roots of the quadratic polynomial:

$$x_{1,2} = \frac{ - b \pm \sqrt{b^2 - 4ac} }{ 2a }$$

table of contents

enable toc on page.

show_toc: true

escaping hugo shortcode

change your shortcode from

{{< year >}}

to

{{< /*year*/ >}}

table

Has 3 optional arguments, id, class and title.

{{< table title="Environment" class="table mx-auto border border-slate-500" >}}
| key  | value     |
| ---- | --------- |
| host | localhost |
{{< /table >}}
Click to Open hugo-shortcode-table.html

details

Creates a details HTML element. You can pass your title to summary element to setup title argument.

Has 3 arguments:

{{< details title="\*Hello, Planet." >}}
[[Official]*ハロー、プラネット。](https://www.youtube.com/watch?v=oVb6Gkf-IJM)
{{< /details >}}

will produce

Click to Open *Hello, Planet. [Official]*ハロー、プラネット。
Click to Open hugo-shortcode-details.html

gist

A simple gist shortcode.

{{< gist author="exkuretrol" hash="88a4dfda6f4f25dc09c6ab472f4a44bb" >}}