重拾Blog

为什么我要重新来写blog,还是要坚持分享。

hugo常用

1
2
3
4
5
6
../hugo.exe server

$ cat ~/.bashrc
alias ub="git add . && git commit -m 'update blog' && git push"

# 每次在git bash里面执行ub即可

主题定制化

标题自动编号

_single.scss中给标题自动编号(参考typora)

 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
71
72
73
74
/** initialize css counter */
#content {
    counter-reset: h2
}

h2 {
    counter-reset: h3
}

h3 {
    counter-reset: h4
}

h4 {
    counter-reset: h5
}

h5 {
    counter-reset: h6
}

/** put counter result into headings */
#content h2:before {
    counter-increment: h2;
    content: counter(h2) ". "
}

#content h3:before,
h3.header-mark:before /** override the default style for focused headings */ {
    counter-increment: h3;
    content: counter(h2) "." counter(h3) " "
}

#content h4:before,
h4.header-mark:before {
    counter-increment: h4;
    content: counter(h2) "." counter(h3) "." counter(h4) " "
}

#content h5:before,
h5.header-mark:before {
    counter-increment: h5;
    content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " "
}

#content h6:before,
h6.header-mark:before {
    counter-increment: h6;
    content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) " "
}

/** override the default style for focused headings */
#content>h3.header-mark:before,
#content>h4.header-mark:before,
#content>h5.header-mark:before,
#content>h6.header-mark:before,
h3.header-mark:before,
h4.header-mark:before,
h5.header-mark:before,
h6.header-mark:before {
    color: inherit;
    border: inherit;
    border-radius: inherit;
    position: inherit;
    left:initial;
    float: none;
    top:initial;
    font-size: inherit;
    padding-left: inherit;
    padding-right: inherit;
    vertical-align: inherit;
    font-weight: inherit;
    line-height: inherit;
}

目录自动编号

修改_toc.scss

因为blog的toc并没有给不同级别的标题添加不同的class,所以没法参考typora的方式来自动编号。

暂时我也没想到好的方案。

image-20231115101716510

hexo icarus(2020-8-15)

博客主题

icarus hexo-theme-amazing

炫酷的页面元素

Bulma文档

图片

1.图床使用的是七牛云 2.Mac有个很好用的上传图片的工具iPic

SSL

又拍云的免费SSL

CDN

又拍云的免费CDN

博客自定义

https://www.alphalxy.com/2019/03/customize-icarus/

自定义diff

参考

Icarus 常见问题 活用 Bulma 美化 Icarus 文章