为 Hexo NexT 主题配置霞鹜文楷字体

0x0. 前言

逛 GitHub 时发现一款非常好康的字体——霞鹜文楷

我是如此时尚(虽然它已经发布好久了),自然要把它请进我的小站。
这里记一下折腾过程。

0x1. 修改步骤

  1. 新建 source/_data/head.njk 并添加如下内容:

    1
    <link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/@callmebill/lxgw-wenkai-web@latest/style.css" />
  2. 修改 NexT 主题的 _config.yml

    1. 找到 custom_file_path 项,添加(或取消注释)head: source/_data/head.njk

    2. 找到 Font Settings,更改为:

      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
      font:
      enable: true

      host: https://fonts.loli.net

      global:
      external: false
      family: "LXGW WenKai"
      size:

      title:
      external: true
      family:
      size:

      headings:
      external: true
      family:
      size:

      posts:
      external: true
      family:

      codes:
      external: false
      family: "LXGW WenKai Mono, Source Code Pro"
      # family: "JetBrains Mono"
  3. 齐活!✅