This is the multi-page printable view of this section. Click here to print.
Blog
Markdown 效果展示
H1
H2 标题
H3
H4
H5
H6
####### H7
######## H8
emoji
👨🏻💻 🕵️♂️ 🦌 🐳 🙄 🤹 💲
表格
形状 | 边数 |
---|---|
Triangle | 3 |
Square | 4 |
形状 | 边数 |
---|---|
Triangle | 3 |
Square | 4 |
列表
- This is an unordered list following a header.
- This is an unordered list following a header.
- This is an unordered list following a header.
- This is an ordered list following a header.
- This is an ordered list following a header.
- This is an ordered list following a header.
- It may seem strange to see a “Hello” post from a project that’s several years old
- but as Docsy matures as a community-driven project
- we thought it was time to (re)introduce ourselves and talk about what’s new with your favorite (we hope) Hugo documentation theme!
链接
Docsy now has a Project Steering Committee! The PSC members are @chalin, @LisaFC, @geriom, and @emckean. If you’re interested in serving on the PSC, open an issue and nominate yourself!
公式
数学公式
KaTeX LaTeX
内联公式:
When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c= 0\) and they are \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\).
显示模式的公式:
The probability of getting \(k\) heads when flipping \(n\) coins is:
$$ \tag*{(1)} P(E) = {n \choose k} p^k (1-p)^{n-k} $$
化学方程式和物理单位的显示
mhchem
Precipitation of barium sulfate: \(\ce{SO4^2- + Ba^2+ -> BaSO4 v}\)
$$ \tag*{(2)} \ce{Zn^2+ <=>[+ 2OH-][+ 2H+] $\underset{\text{amphoteric hydroxide}}{\ce{Zn(OH)2 v}}$ <=>[+ 2OH-][+ 2H+] $\underset{\text{tetrahydroxozincate}}{\ce{[Zn(OH)4]^2-}}$} $$
- Scientific number notation: \(\pu{1.2e3 kJ}\) or \(\pu{1.2E3 kJ}\) \
- Divisions: \(\pu{123 kJ/mol}\) or \(\pu{123 kJ//mol}\)
绘制图表
Mermaid
graph TD Start --> Need{"Hugo version >= 0.93.0"} Need -- No --> Off["Set params.mermaid.enable = true"] Off --> Author Need -- Yes --> Author[Insert mermaid codeblock]
PlantUML
participant participant as Foo
actor actor as Foo1
boundary boundary as Foo2
control control as Foo3
entity entity as Foo4
database database as Foo5
collections collections as Foo6
queue queue as Foo7
Foo -> Foo1 : To actor
Foo -> Foo2 : To boundary
Foo -> Foo3 : To control
Foo -> Foo4 : To entity
Foo -> Foo5 : To database
Foo -> Foo6 : To collections
Foo -> Foo7: To queue
MarkMap
# markmap
## Links
- <https://markmap.js.org/>
- [GitHub](https://github.com/gera2ld/markmap)
## Related
- [coc-markmap](https://github.com/gera2ld/coc-markmap)
- [gatsby-remark-markmap](https://github.com/gera2ld/gatsby-remark-markmap)
## Features
- links
- **inline** ~~text~~ *styles*
- multiline
text
- `inline code`
-
```js
console.log('code block');
```
- Katex - $x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
博客构架工具对比
- dynamic | WordPress - PHP
- 问题:
- 环境。。。维护!维护!维护!
- 插件。。。维护!维护!维护!
- 安全警告?维护!维护!维护!
- 性能。。。钱!钱!钱!
- 备份!备份!备份!
- 问题:
- static | hugo - Go
- static | jekyll - Ruby
- github | 2023年10月23日 star=47k
- 问题:
- 环境复杂 (主要是不熟悉 Ruby 环境)
- 中文资料不多
- 构建时,插件需要同步更新
- static | hexo - node.js
- github | 2023年10月23日 star=37k
- 问题:
- 默认提供的功能相对有限
- 插件需要定期更新维护
- static | mkdocs - python
- github | 2023年10月20日 star=17k
- themes
- mkdocs-material | 2023年10月20日 16k star
- static | mdBook - Rust
- ??? | Pelican - Python
- ??? | Rails - ???
- ??? | Express.js - node.js???
- ??? | gitbook - ???
测试Template中函数/变量的取值
This is Content!
使用 {{.Name}}
形式调用。
Shortcode
this Shortcode
code | value |
---|---|
.Name | test/test-template |
.Ordinal | 0 |
.Page | see “.Page” |
.Parent | <nil> |
.Position | "/home/runner/work/hugo-usage-doc/hugo-usage-doc/content/zh-cn/blog/2023/test-template.md:10:1" |
.IsNamedParams | true “This is Params!” |
.Inner | " This is Inner! " |
.Scratch | {map[] {{0 0} 0 0 {{} 0} {{} 0}}} |
.InnerDeindent | " This is Inner! " |
Page
This Page
code | value |
---|---|
.Page.AlternativeOutputFormats | [] |
.Page.Aliases | [] |
.Page.Ancestors | Pages(2) |
.Page.BundleType | |
.Page.Content | "" |
.Page.Data | map[] |
.Page.Date | 2023-10-22 07:43:49 +0800 +0800 |
.Page.Description | "包括:站点变量(.Site)、页面变量(.Page)、简码变量、函数 " |
.Page.Draft | `false` |
.Page.ExpiryDate | 0001-01-01 00:00:00 +0000 UTC |
.Page.File | blog/2023/test-template.md |
.Page.Fragments | todo |
.Page.FuzzyWordCount | 0 |
.Page.IsHome | false |
.Page.IsNode | false |
.Page.IsPage | true |
.Page.IsSection | false |
.Page.IsTranslated | false |
.Page.Keywords | [] |
.Page.Kind | page |
.Page.Language | zh-cn |
.Page.Lastmod | 2023-11-04 10:26:54 +0800 +0800 |
.Page.LinkTitle | 测试Template中函数/变量的取值 |
.Page.Next | Page(/blog/2023/comparing-blog-frameworks.md) |
.Page.NextInSection | Page(/blog/2023/comparing-blog-frameworks.md) |
.Page.OutputFormats | [{canonical {html text/html index canonical false true false false true 10} /hugo-usage-doc/blog/2023/test-template/ https://lawsssscat.github.io/hugo-usage-doc/blog/2023/test-template/}] |
.Page.Permalink | https://lawsssscat.github.io/hugo-usage-doc/blog/2023/test-template/ |
.Page.Plain | |
.Page.PlainWords | [] |
.Page.Prev | Page(/docs/hugo/language.md) |
.Page.PrevInSection | Page(/blog/2023/readme.md) |
.Page.PublishDate | 2023-10-22 07:43:49 +0800 +0800 |
.Page.RawContent | todo
This is Content! {{% test/test-template param_01="This is Params!" %}} This is Inner! {{% /test/test-template %}} |
.Page.RenderShortcodes | see "Shortcode" |
.Page.ReadingTime | 0 |
.Page.Resources | [] |
.Page.Ref | todo |
.Page.RelRef | todo |
.Page.RelPermalink | /hugo-usage-doc/blog/2023/test-template/ |
.Page.Site | see "Site" |
.Page.Sites | todo |
.Page.Summary | |
.Page.TableOfContents | |
.Page.Title | 测试Template中函数/变量的取值 |
.Page.Translations | Pages(0) |
.Page.TranslationKey | page/blog/2023/test-template |
.Page.Truncated | false |
.Page.Type | blog |
.Page.Weight | 0 |
.Page.WordCount | 0 |
“Home” Page
code | value |
---|---|
Title | 首页(Home) |
Kind | home |
Type | page |
Section Page
# ""
code | value |
---|---|
Title | |
Kind | section |
Type | docs |
# “Blog”
code | value |
---|---|
Title | Blog |
Kind | section |
Type | blog |
# “Community”
code | value |
---|---|
Title | Community |
Kind | section |
Type | community |
Site
code | value |
---|---|
.Site.AllPages | |
.Site.BaseURL | https://lawsssscat.github.io/hugo-usage-doc/ |
.Site.BuildDrafts | |
.Site.Copyright | |
.Site.Data | |
.Site.Home | Page(/_index.md) |
.Site.IsMultiLingual | false |
.Site.Language.Lang | zh-cn |
.Site.Language.LanguageName | |
.Site.Language.Weight | 0 |
.Site.Language | zh-cn |
.Site.LanguageCode | zh-Hans |
.Site.LanguagePrefix | |
.Site.Languages | [zh-cn] |
.Site.LastChange | 2023-11-04 10:26:54 +0800 +0800 |
.Site.Menus | map[main:[0xc00095c380 0xc00095c2a0 0xc00095c1c0]] |
.Site.Pages | Pages(35) |
.Site.RegularPages | Pages(19) |
.Site.Sections | Pages(3) |
.Site.Taxonomies | TaxonomyList(2) |
.Site.Title | Hugo 使用手册 |