HomePage的侧边卡片样式

尝试修改主页面右侧卡片的样式,在 _config.butterfly.yml 中的 Inject 部分引入css文件:

1
2
3
4
5
6
7
8
9
# Inject
# Insert the code to head (before '</head>' tag) and the bottom (before '</body>' tag)
# 插入代码到头部 </head> 之前 和 底部 </body> 之前
inject:
head:
# - <link rel="stylesheet" href="/xxx.css">
- <link rel="stylesheet" href="/config/css/aside_card.css">
bottom:
# - <script src="xxxx"></script>

错误如下:

1
Refused to apply style from 'http://localhost:4000/config/css/aside_card.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

报错:.css文件引入错误,证明 url不对 或者是 文件放置的位置有误

问了朋友LiuShen,发现是我的config文件夹放错了位置,应该放在根目录的source中

问题解决~

.css成功引入,但未生效

根目录/source/config/css/aside_card.css成功引入,但是不起作用

1
2
3
4
5
6
7
8
9
10
11
/*
个人信息卡片
*/
// 圆角
#aside-content>.card-widget.card-info>#card-info-btn {
border-radius: 10px;
}
// 缩放
#aside-content>.card-widget.card-info>#card-info-btn:hover {
transform: scale(1.1);
}

报错:

css文件中,注释为 /* */,不可用双斜线。此处双斜线没有报错,但估计对css的编译造成了影响

问题解决~

abbrlink生成八位hex不生效

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# _config.yml
permalink: posts/:abbrlink.html

abbrlink:
alg: crc32 #support crc16(default) and crc32 进制
rep: hex #support dec(default) and hex 算法
drafts: false #(true)Process draft,(false)Do not process draft. false(default)
## Generate categories from directory-tree
## depth: the max_depth of directory-tree you want to generate, should > 0
auto_category:
enable: true #true(default)
depth: #3(default)
over_write: false
auto_title: false #enable auto title, it can auto fill the title by path
auto_date: false #enable auto date, it can auto fill the date by time today
force: false #enable force mode,in this mode, the plugin will ignore the cache, and calc the abbrlink for every post even it already had abbrlink.

报错:

按照abbrlink教程来的,但是生成的永久链接居然是十进制(0、1023…)

解决方案:保持alg为crc32,rep为hex,然后hexo clean、hexo g,接着删除各文章下的abbrlink即可,会在下一次hexo s时生成新的