Common Blog Commands (For Offline Use)

Record some common commands for offline editing

Blog Command Records

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: Date (1111-11-11)
image: Featured image to display
comments: Show / hide comments section (T/F)
license: Article license, input false to hide
hidden: Hide article (Not shown on homepage, archives, etc., but can be accessed directly via link)
math: Whether to load KaTeX script
slug: Permalink
draft: Whether it is a draft
categories:
    - Categories
tags:
    - Tags
lastmod: Last modified time
keywords: "Keywords"
 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
43
44
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6

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

Use three or more asterisks *, dashes -, 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 link)

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

Table alignment:
| Left aligned | Right aligned | Center aligned |
| :---- | ----: | :----: |
| Content | Content | Content |

Shortcodes

Stack comes with a set of shortcodes, which 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 loading, normally it should be {< content >}

The Video_ID can be found in the video’s URL. For example, the video ID of 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 part of the video to play. For example, the part number for https://www.bilibili.com/video/av12345678?p=2 is 2.

Tencent Video

Embed a Tencent Video video.

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

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

YouTube Video

Embed a YouTube video.

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

The Video_ID can be found in the video’s URL. For example, the video ID of `

General Video File

Embed a video file.

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

Video API Test (MP4)

1
{< video src="" autoplay="false" poster="./avatar.webp" >} # To prevent loading, 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 in your site’s static/video/my-video.mp4 folder.

The autoplay attribute is optional. It can be used to specify whether the video should play automatically. 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 loading, normally it should be {< content >}

The SNIPPET_ID can be found in the snippet’s URL. For example, the snippet ID of 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 loading, 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 loading, normally it should be {< content >}

With the above organization, 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)

It will render as two rows: the first row will have two images, and the second row will have one image.

2022-2025做了三年的事情,得到了很多收获也看到了这个世界的另一面。
Built with Hugo
Theme Stack designed by Jimmy