Meekdai / Gmeek

Gmeek is a Blog All in Github
https://meekdai.github.io
MIT License
1.56k stars 224 forks source link

请问如何自定义CSS? #90

Open WangZhSi opened 3 months ago

WangZhSi commented 3 months ago

我看到config.json中有关于自定义css的字段“style”

在这基础上, 我自定义了一个css放在了新目录_assets下, 仅修改了字体(‘sans-serif’)做尝试, 并将css的绝对路径https://github.com/WangZhSi/WangZhSi.github.io/blob/main/_assets/style.css填写到了json文件中, 但是实际渲染并没有依据我的css渲染, 请问是我的使用方式哪里有问题吗?

另外关于同一仓库的文件调用问题, 假如我在css中自定义了字体:

@font-face {
    font-family: 'myLXGW';
    src: url();
}

此处url是否可以使用相对路径? 还是必须使用上面如同css绝对路径一样的格式?

谢谢!

Meekdai commented 3 months ago

github的文件不能直接这样使用的,你可以使用CDN,地址如下

https://cdn.jsdelivr.net/gh/WangZhSi/WangZhSi.github.io@main/_assets/style.css