Hugo使用自定义字体
有一天看到了别人的博客,发现那个字体真好看啊 F12 去看了下随后去搜了搜,发现了是一个开源的字体 https://github.com/lxgw/LxgwWenKai 名字起的也挺好听的:霞鹜文楷 下面介绍一下我的博客修改这个字体的方法 博客说明 Hugo + PaperMod 可参考:Blog All Process 参考 在官方 github 上找到了 cdn:https://github.com/lxgw/LxgwWenKai/issues/24 下面是原话: 关于chawyehsu制作的webfont, 我向cdnjs提了pr, 目前merge了, 国内已有镜像, 有需要的可以使用. https://cdn.staticfile.org/lxgw-wenkai-webfont/1.6.0/style.css https://cdn.staticfile.org/lxgw-wenkai-screen-webfont/1.6.0/style.css 目前只有这两个, 其他的没提交 参考引入 <html> <head> <link rel="stylesheet" href="https://cdn.staticfile.org/lxgw-wenkai-webfont/1.6.0/style.css" /> <!-- 没有Lite version, 有需要的可以向cdnjs发pr看看能不能通过--> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lxgw-wenkai-lite-webfont@1.1.0/style.css" /> <!-- 没有TC version, 有需要的可以向cdnjs发pr看看能不能通过--> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lxgw-wenkai-tc-webfont@1.0.0/style.css" /> <!-- Screen version --> <link rel="stylesheet" href="https://cdn.staticfile.org/lxgw-wenkai-screen-webfont/1.6.0/style.css" /> <style> body { font-family: "LXGW WenKai", sans-serif; /* Lite version */ font-family: "LXGW WenKai Lite", sans-serif; /* TC version */ font-family: "LXGW WenKai TC", sans-serif; /* Screen version */ font-family: "LXGW WenKai Screen", sans-serif; } </style> </head> <body> <!-- blablabla --> </body> </html> 使用方式 两个关键文件 ...