Markdown 效果展示

展示当前主题下,Markdown语句的编译效果。

H1

H2 标题

H3

H4

H5
H6

####### H7

######## H8

emoji

👨🏻‍💻 🕵️‍♂️ 🦌 🐳 🙄 🤹 💲

表格

形状边数
Triangle3
Square4
形状边数
Triangle3
Square4

列表

  • This is an unordered list following a header.
  • This is an unordered list following a header.
  • This is an unordered list following a header.
  1. This is an ordered list following a header.
  2. This is an ordered list following a header.
  3. 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}$$

$$ \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-}}$}$$

$$ \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
    • github | 2023年10月23日 star=69k
    • themes
    • 问题:
      • 入门门槛相对高 (主要是概念多且相互关联。好在官方文档足够详细)
  • static | jekyll - Ruby
    • github | 2023年10月23日 star=47k
    • 问题:
      • 环境复杂 (主要是不熟悉 Ruby 环境)
      • 中文资料不多
      • 构建时,插件需要同步更新
  • static | hexo - node.js
    • github | 2023年10月23日 star=37k
    • 问题:
      • 默认提供的功能相对有限
      • 插件需要定期更新维护
  • static | mkdocs - python
  • static | mdBook - Rust
  • ??? | Pelican - Python
  • ??? | Rails - ???
  • ??? | Express.js - node.js???
  • ??? | gitbook - ???

测试Template中函数/变量的取值

包括:站点变量(.Site)、页面变量(.Page)、简码变量、函数

This is Content!

使用 {{.Name}} 形式调用。

Shortcode

this Shortcode

codevalue
.Nametest/test-template
.Ordinal0
.Pagesee “.Page”
.Parent<nil>
.Position"/home/runner/work/hugo-usage-doc/hugo-usage-doc/content/zh-cn/blog/2023/test-template.md:10:1"
.IsNamedParamstrue “This is Params!”
.Inner" This is Inner! "
.Scratch{map[] {{0 0} 0 0 {{} 0} {{} 0}}}
.InnerDeindent" This is Inner! "

Page

This Page

codevalue
.Page.AlternativeOutputFormats[]
.Page.Aliases[]
.Page.AncestorsPages(2)
.Page.BundleType
.Page.Content""
.Page.Datamap[]
.Page.Date2023-10-22 07:43:49 +0800 +0800
.Page.Description"包括:站点变量(.Site)、页面变量(.Page)、简码变量、函数 "
.Page.Draft`false`
.Page.ExpiryDate0001-01-01 00:00:00 +0000 UTC
.Page.Fileblog/2023/test-template.md
.Page.Fragmentstodo
.Page.FuzzyWordCount0
.Page.IsHomefalse
.Page.IsNodefalse
.Page.IsPagetrue
.Page.IsSectionfalse
.Page.IsTranslatedfalse
.Page.Keywords[]
.Page.Kindpage
.Page.Languagezh-cn
.Page.Lastmod2023-11-04 10:26:54 +0800 +0800
.Page.LinkTitle测试Template中函数/变量的取值
.Page.NextPage(/blog/2023/comparing-blog-frameworks.md)
.Page.NextInSectionPage(/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.Permalinkhttps://lawsssscat.github.io/hugo-usage-doc/blog/2023/test-template/
.Page.Plain
.Page.PlainWords[]
.Page.PrevPage(/docs/hugo/language.md)
.Page.PrevInSectionPage(/blog/2023/readme.md)
.Page.PublishDate2023-10-22 07:43:49 +0800 +0800
.Page.RawContenttodo This is Content!

{{% test/test-template param_01="This is Params!" %}} This is Inner! {{% /test/test-template %}}

.Page.RenderShortcodessee "Shortcode"
.Page.ReadingTime0
.Page.Resources[]
.Page.Reftodo
.Page.RelReftodo
.Page.RelPermalink/hugo-usage-doc/blog/2023/test-template/
.Page.Sitesee "Site"
.Page.Sitestodo
.Page.Summary
.Page.TableOfContents
.Page.Title测试Template中函数/变量的取值
.Page.TranslationsPages(0)
.Page.TranslationKeypage/blog/2023/test-template
.Page.Truncatedfalse
.Page.Typeblog
.Page.Weight0
.Page.WordCount0

“Home” Page

codevalue
Title首页(Home)
Kindhome
Typepage

Section Page

# ""

codevalue
Title
Kindsection
Typedocs

# “Blog”

codevalue
TitleBlog
Kindsection
Typeblog

# “Community”

codevalue
TitleCommunity
Kindsection
Typecommunity

Site

codevalue
.Site.AllPages
.Site.BaseURLhttps://lawsssscat.github.io/hugo-usage-doc/
.Site.BuildDrafts
.Site.Copyright
.Site.Data
.Site.HomePage(/_index.md)
.Site.IsMultiLingualfalse
.Site.Language.Langzh-cn
.Site.Language.LanguageName
.Site.Language.Weight0
.Site.Languagezh-cn
.Site.LanguageCodezh-Hans
.Site.LanguagePrefix
.Site.Languages[zh-cn]
.Site.LastChange2023-11-04 10:26:54 +0800 +0800
.Site.Menusmap[main:[0xc00095c380 0xc00095c2a0 0xc00095c1c0]]
.Site.PagesPages(35)
.Site.RegularPagesPages(19)
.Site.SectionsPages(3)
.Site.TaxonomiesTaxonomyList(2)
.Site.TitleHugo 使用手册

项目说明

当前项目的 README.md 文档

Getting Started

1npm install
1npm run prepare
2npm run server
3npm run build
4npm run clean
5npm run build:production

Contribution Guidelines

markdown style

1# vscode
2code --install-extension DavidAnson.vscode-markdownlint