Back

Blog Common Commands (Offline Use)

Record some common commands for offline editing

Table of contents

TL;DR / Geek Summary:

  • Cheat Sheet: Offline reference for Hugo Stack theme parameters and Markdown syntax.
  • Shortcode Arsenal: Documentation for embedding Bilibili, YouTube, galleries, and encrypted blocks.
  • CLI Helper: Includes Batch script commands for public folder encryption.

# Blog Commands Record

# Code Block Language Support

PrefixLanguage
AABAP, ABNF, ActionScript, ActionScript 3, Ada, AL, Angular2, ANTLR, ApacheConf, APL, AppleScript, ArangoDB AQL, Arduino, ArmAsm, AutoHotkey, AutoIt, Awk
BBallerina, Bash, Bash Session, Batchfile, BibTeX, Bicep, BlitzBasic, BNF, BQN, Brainfuck
CC, C#, C++, Caddyfile, Caddyfile Directives, Cap’n Proto, Cassandra CQL, Ceylon, CFEngine3, cfstatement, ChaiScript, Chapel, Cheetah, Clojure, CMake, COBOL, CoffeeScript, Common Lisp, Coq, Crystal, CSS, Cython
DD, Dart, Diff, Django/Jinja, dns, Docker, DTD, Dylan
EEBNF, Elixir, Elm, EmacsLisp, Erlang
FFactor, Fennel, Fish, Forth, Fortran, FortranFixed, FSharp
GGAS, GDScript, Genshi, Genshi HTML, Genshi Text, Gherkin, GLSL, Gnuplot, Go, Go HTML Template, Go Text Template, GraphQL, Groff, Groovy
HHandlebars, Haskell, Haxe, HCL, Hexdump, HLB, HLSL, HolyC, HTML, HTTP, Hy
IIdris, Igor, INI, Io, ISCdhcpd
JJ, Java, JavaScript, JSON, Julia, Jungle
KKotlin
LLighttpd configuration file, LLVM, Lua
MMakefile, Mako, markdown, Mason, Mathematica, Matlab, mcfunction, Meson, Metal, MiniZinc, MLIR, Modula-2, MonkeyC, MorrowindScript, Myghty, MySQL
NNASM, Natural, Newspeak, Nginx configuration file, Nim, Nix
OObjective-C, OCaml, Octave, Odin, OnesEnterprise, OpenEdge ABL, OpenSCAD, Org Mode
PPacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Plutus Core, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerQuery, PowerShell, Prolog, PromQL, properties, Protocol Buffer, PSL, Puppet, Python, Python 2
QQBasic, QML
RR, Racket, Ragel, Raku, react, ReasonML, reg, reStructuredText, Rexx, Ruby, Rust
SSAS, Sass, Scala, Scheme, Scilab, SCSS, Sed, Sieve, Smali, Smalltalk, Smarty, Snobol, Solidity, SourcePawn, SPARQL, SQL, SquidConf, Standard ML, stas, Stylus, Svelte, Swift, SYSTEMD, systemverilog
TTableGen, Tal, TASM, Tcl, Tcsh, Termcap, Terminfo, Terraform, TeX, Thrift, TOML, TradingView, Transact-SQL, Turing, Turtle, Twig, TypeScript, TypoScript, TypoScriptCssData, TypoScriptHtmlData
VV, V shell, Vala, VB.net, verilog, VHDL, VHS, VimL, vue
WWDTE, WebGPU Shading Language, Whiley
XXML, Xorg
YYAML, YANG
ZZ80 Assembly, Zed, Zig

FrontMatter Field Meanings

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
title: Title
description: Description
date: Time (1111-11-11)
image: Featured image to display
comments: Show / Hide comments section (T/F)
license: Article license. Enter false to hide
hidden: Hide article (won't show on home page, archives, etc., but accessible via direct link)
math: Whether to load KaTeX scripts
slug: Permalink
draft: Whether it's a draft
categories:
    - Categories
tags:
    - Tags
lastmod: Last updated time
keywords: "Keywords"

# MarkDown Basics

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# I am a level 1 heading
## I am a level 2 heading
### I am a level 3 heading
#### I am a level 4 heading
##### I am a level 5 heading
###### I am a level 6 heading

*Italic text*
**Bold text**
***Bold italic text***

Use three or more asterisks *, hyphens -, or underscores _ on a single line to create a horizontal rule.

~~Strikethrough~~
<u>Underlined text</u>

Create a footnote format like this[^Footnote].
[^Footnote]: Content of the footnote

List:
- Item 1
- Item 2
- Item 3

Ordered List:
1. First item
2. Second item
3. Third item

> Blockquote[Link Text](URL)
![Image Description](Image_URL)

Table:
| Header 1 | Header 2 |
| ---- | ---- |
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4 |

Table Alignment:
| Left Align | Right Align | Center Align |
| :---- | ----: | :----: |
| Content | Content | Content |

# Shortcodes

Stack comes with a set of shortcodes that you can use in your content.

This page only contains shortcodes specific to Stack. Hugo’s built-in shortcodes are documented here .

# Bilibili Video

Embed a Bilibili video.

1
{< bilibili VIDEO_ID PART_NUMBER >} # To prevent rendering, normally it should be {< content >}

The Video_ID can be found in the video’s URL. For example, the video ID for https://www.bilibili.com/video/av12345678 is av12345678. Both AV and BV are supported.

The PART_NUMBER is optional. It can be used to specify the video part to play. For example, the part number for https://www.bilibili.com/video/av12345678?p=2 is 2.

# Tencent Video

Embed a Tencent Video .

1
{< tencent VIDEO_ID >} # To prevent rendering, normally it should be {< content >}

The Video_ID can be found in the video’s URL. For example, the video ID for https://v.qq.com/x/cover/hzgtnf6tbvfekfv/g0014r3khdw.html is g0014r3khdw.

# YouTube Video

Embed a YouTube video.

1
{< youtube VIDEO_ID >}  # To prevent rendering, normally it should be {< content >}

The Video_ID can be found in the video’s URL.

# Generic Video File

Embed a video file.

1
2
3
# To prevent rendering, normally it should be {< content >}
{< video src="VIDEO_URL" autoplay="true" poster="./video-poster.webp" >} # To prevent rendering, normally it should be {< content >}

The VIDEO_URL can be a URL or a path relative to the static directory. For example, src="/video/my-video.mp4" will embed the video file located at static/video/my-video.mp4 in your site folder.

The autoplay attribute is optional. It can be used to specify whether the video should auto-play. The poster attribute is optional. It can be used to specify a poster image for the video.

# GitLab

Embed a GitLab snippet.

1
{< gitlab SNIPPET_ID >}  # To prevent rendering, normally it should be {< content >}

The SNIPPET_ID can be found in the snippet’s URL. For example, the snippet ID for https://gitlab.com/-/snippets/1234567 is 1234567.

# Quote

1
2
3
{< quote author="A famous person" source="The book they wrote" url="https://en.wikipedia.org/wiki/Book">}  # To prevent rendering, normally it should be {< content >}
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.
{< /quote >}  # To prevent rendering, normally it should be {< content >}

With the organization above, you can insert images into your content like this:

1
2
3
--- content/post/my-first-post/index.md ---
![Image 1](image1.webp)
![Image 2](image2.webp)

To insert an image gallery, you need to create a page bundle for the gallery. For example:

1
2
3
4
5
6
7
content
└── gallery
    └── my-first-gallery
        ├── index.md
        ├── image1.webp
        ├── image2.webp
        └── image3.webp
1
2
3
--- content/gallery/my-first-gallery/index.md ---
![Image 1](image1.webp) ![Image 2](image2.webp)
![Image 1](image3.webp)

This will render two rows: the first row with two images, and the second row with one image.

# Gaussian Blur

Entering this directly in your article gives a Gaussian blur effect~

1
<span class="blur">This is a Gaussian blur effect~ </span>

# Blackout Effect

Entering this directly in your article gives a blackout effect: Hehehe, I’m hidden!

1
<span class="shady">Hehehe, I'm hidden!</span>

# Gotchas / Pitfalls

Doing it this way ruins line breaks with the Enter key/Tab = =. You can use <br> at the end of the line to break lines.

1
2
3
<span class="blur">Line 1 <br>
Line 2 <br>
Line 3</span>

# Because it’s useless = = (Instant Answer)

Don’t hit me runs away)

Supports Mermaid JS and KaTeX math formulas.

Already embedded into the cfg file.

# Hugo Post Encryption


# title: “This Is An Encrypted Post”

This content is visible to anyone.

The following content is protected.

This content will be encrypted!

1
2
3
4
5
6
7
8

    This content is visible to anyone.
    
    {% hugo-encrypt "postspecificpassword" %}  # To prevent rendering, normally it should be {< content >}
    
    This content will be encrypted!
    
    {% /hugo-encrypt %}  # To prevent rendering, normally it should be {< content >}

# Video API Test (MP4)

1
{< video src="" autoplay="false" poster="./avatar.webp" >} # To prevent rendering, normally it should be {< content >}

# Highlight text (Mark)

This is highlighted text
1
    {< mark text="This is highlighted text" >}

# Abbreviation

Abbreviated text
1
    {< abbr title="Here is a very, very, very, very, very, very, very, very long abbreviation content~" text="Abbreviated text" >} # To prevent rendering, normally it should be {< content >}

# Center Text

Center text

1
    {< align center "Center text" >} # To prevent rendering, normally it should be {< content >}

# Blockquote

Death is not the end of everything, forgetting is.

1
2
3
    {< blockquote author="Movie" link="https://irithys.com" title="Coco" >} # To prevent rendering, normally it should be {< content >}
    Death is not the end of everything, forgetting is.
    {< /blockquote >}

# Details (Hidden)

Click me! Sending deep blessings to the person reading this line!
1
2
3
    {< detail "Click me!" >} # To prevent rendering, normally it should be {< content >}
    Sending deep blessings to the person reading this line!
    {< /detail >}

# Notice

Warning! This notice looks so good, I couldn’t resist sharing it.

1
2
3
{< notice notice-warning >}  # To prevent rendering, normally it should be {< content >}
Warning! This notice looks so good, I couldn't resist sharing it.
{< /notice >}

This is the first notice. You can change notice-warning to notice-note, notice-info, or notice-tip to get three other differently styled notices.

# Music

1
{< music id="557578993" type="song" server="netease" >} # To prevent rendering, normally it should be {< content >}

# NetEase Cloud Music

1
{< netease 557578993 0 >}} # To prevent rendering, normally it should be {< content >}

# Keyboard Input

1
Press <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>Delete</kbd> to end the session.

Press CTRL + ALT + Delete to end the session.

# GitHub

public
The world’s fastest framework for building websites.
GO
1
{< github name="hugo" link="https://github.com/gohugoio/hugo" description="The world’s fastest framework for building websites." color="#00add8" language="GO" >}
ParameterExplanation
nameRepository name
linkLink
descriptionDescription
colorColor
languageLanguage

# Simple Colored Notice

warning can be changed to info tip note

1
2
3
{< simple-notice simple-notice-warning >}
warning can be changed to info tip note 
{< /simple-notice >}

# Blockquote 2

Ten miles of green hills stretch far, the tide is flat, the road bears sand. A few bird cries lament the passing years. It is a desolate time again, at the end of the world. White dew gathers the waning moon, a clear breeze scatters the morning glow. By the green weeping willow bank, I ask the lotus. Do you remember the house where we bought wine in the years past?

1
2
3
{< myquote >}
Ten miles of green hills stretch far, the tide is flat, the road bears sand. A few bird cries lament the passing years. It is a desolate time again, at the end of the world. White dew gathers the waning moon, a clear breeze scatters the morning glow. By the green weeping willow bank, I ask the lotus. Do you remember the house where we bought wine in the years past?
{< /myquote >}

# Center Quote Block

Ten miles of green hills stretch far, the tide is flat, the road bears sand
A few bird cries lament the passing years
It is a desolate time again, at the end of the world
White dew gathers the waning moon, a clear breeze scatters the morning glow

1
2
3
{< quote-center >}
Ten miles of green hills stretch far, the tide is flat, the road bears sand<br>A few bird cries lament the passing years<br>It is a desolate time again, at the end of the world<br>White dew gathers the waning moon, a clear breeze scatters the morning glow
{< /quote-center >}
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10

{< galleries >}

{< gallery src="https://cdn.lovir.cn/photo/DSCF9645.webp" >}

{< gallery src="https://cdn.lovir.cn/photo/DSCF7385.webp" >}

{< gallery src="https://cdn.lovir.cn/photo/DSCF6903.webp" >}

{< /galleries >}

# Spotify

1
{{/*< spotify type="track" id="2D3gvohUyOfXIVX6Mvhqae" height="80px">*/}}
// layouts/shortcodes/spotify.html

# Timeline

{{< timeline date=“2023-09-10” title=“awa” description=“awa” tags=“awa” url=“awa” >}}

{{/< timeline date=“2023-09-10” title="" description="" tags="" url="" >/}}

# Chat

{{< chat position=“left” name=“John Doe” timestamp=“2023-09-12 14:30”>}} This is the message content on the left. {{< /chat >}}

{{< chat position=“right” name=“Alice” timestamp=“2023-09-12 14:45” >}} This is the message content on the right, testing a looooooooooooooooooong length. {{< /chat >}}

# Blog Encryption Command (jiami.bat)

This command is used to encrypt specific post content (used in conjunction with the hugo-encrypt shortcode). Please make sure you have the related tools installed.

1
hugo-encrypt -sitePath .\public

转载需要保留原始链接,未经明确许可,禁止商业使用。CC BY-NC-SA 4.0

Last updated on 2026-05-17 16:53 UTC