This is a test page#
本页面用于测试网站的显示格式,以及不同模块的渲染情况。
Subtitle 1#
put some emoji 😄
and some formula $y=x^2$
公式块中换行的\\
要写成\\\
$$
\begin{aligned}
y &= \int_0^a\sqrt{x}dx\\
z &= x\cdot\ln y
\end{aligned}
$$
and some codes
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
package main
import (
"fmt"
"math/rand"
"time"
)
type Moo struct {
Cow int
Sound string
Tube chan bool
}
// A cow will moo until it is being fed
func cow(num int, mootube chan Moo) {
tube := make(chan bool)
for {
select {
case mootube <- Moo{num, "moo", tube}:
fmt.Println("Cow number", num, "mooed through the mootube")
<-tube
fmt.Println("Cow number", num, "is being fed and stops mooing")
mootube <- Moo{num, "mooh", nil}
fmt.Println("Cow number", num, "moos one last time out of happyness")
return
default:
fmt.Println("Cow number", num, "mooed through the mootube and was ignored")
time.Sleep(time.Duration(rand.Int31n(1000)) * time.Millisecond)
}
}
}
// The farmer wants to put food in all the mootubes to stop the mooing
func farmer(numcows int, mootube chan Moo, farmertube chan string) {
fmt.Println("Farmer starts listening to the mootube")
for hungryCows := numcows; hungryCows > 0; {
moo := <-mootube
if moo.Sound == "mooh" {
fmt.Println("Farmer heard a moo of relief from cow number", moo.Cow)
hungryCows--
} else {
fmt.Println("Farmer heard a", moo.Sound, "from cow number", moo.Cow)
time.Sleep(2e9)
fmt.Println("Farmer starts feeding cow number", moo.Cow)
moo.Tube <- true
}
}
fmt.Println("Farmer doesn't hear a single moo anymore. All done!")
farmertube <- "yey!"
}
// The farm starts out with mooing cows that wants to be fed
func runFarm(numcows int) {
farmertube := make(chan string)
mootube := make(chan Moo)
for cownum := 0; cownum < numcows; cownum++ {
go cow(cownum, mootube)
}
go farmer(numcows, mootube, farmertube)
farmerSaid := <-farmertube
if farmerSaid == "yey!" {
fmt.Println("All cows are happy.")
}
}
func main() {
runFarm(4)
fmt.Println("done")
}
|
insert images
Subtitle 2#
表格 |
A |
B |
000 |
111 |
222 |
0000 |
1111 |
2222 |
try quoting?
Blahblahblah…
注脚的编号会根据出现的顺序自动生成
Subtitle 3#
mermaid插件的渲染
在mermaid代码块前后添加:
1
2
3
4
|
<div class="mermaid">
%%{init: {'theme': 'forest', 'fill': 'white', 'securitylevel': 'loose' } }%%
...
</div>
|
%%{init: {'theme': 'forest', 'fill': 'white', 'securitylevel': 'loose' } }%%
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts
prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
%%{init: {'theme': 'dark', 'fill': 'red', 'securitylevel': 'loose' } }%%
flowchart LR
A-->B-->C-->A
将Hugo部署到到Github Pages#
生成网页静态页面文件
进入public文件夹,使用git上传文件
1
2
3
4
5
6
|
cd public
git init ##初始化仓库
git remote add origin https://github.com/username/username.github.io.git ##链接远程仓库
git add .
git commit -m "first commit"
git push -u origin master
|
在此之后更新文章,使用hugo生成新的静态页面,并使用git push进行同步
1
2
3
4
5
|
cd public
git add .
git status
git commit -m "add blog post"
git push
|