First Blog by Hexo

Welcome to Hexo! This is my first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Hexo markdown语法

Clear cache, generate static files and deploy

1
hexo clean && hexo g && hexo de

Create a new post

1
hexo new "My New Post"

More info: Writing

Run server

1
hexo server

More info: Server

Generate static files

1
hexo generate

More info: Generating

Deploy to remote sites

1
hexo deploy

More info: Deployment

Hexo博文撰写规范

  • 新建草稿
1
hexo new draft <title>
  • 一边编辑 markdown 文章,一边使用浏览器预览
1
hexo S --draft
  • 将草稿发布为正式文章
1
hexo P <filename>

样式自定义

替换Mac风格代码块

在主题文件themes\fluid\source\css目录下新建样式文件,如macpanel.styl,内容参考:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
.highlight
background: #21252b
border-radius: 5px
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4)
padding-top: 30px

&::before
background: #fc625d
border-radius: 50%
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b
content: ' '
height: 12px
left: 12px
margin-top: -20px
position: absolute
width: 12px

修改主题配置文件_config.fluid.yml,找到custom_css配置项,引入刚刚新建的样式文件(此处引入.styl文件无需加后缀):

1
2
custom_css:
- /css/macpanel

继续修改_config.fluid.yml,找到code.highlightjs配置项,将代码高亮风格修改暗色风格(dark系列),如:

1
2
3
4
5
6
highlightjs:
# 在链接中挑选 style 填入
# Select a style in the link
# See: https://highlightjs.org/static/demo/
style: "github dark dimmed"
style_dark: "dark"

注:如果选用其他代码高亮风格,有可能会造成代码背景是偏白色的,与黑色的Mac栏不搭。


First Blog by Hexo
https://blog.alist-ruyi.top/2024/09/first-blog/
Author
Ruyi Chen
Posted on
09/03/2024 14:34
Licensed under