字体设置
调整NexT v7.5.0
的字体和大小
大小调整
修改源文件/source/css/_variables/base.styl
// $font-size-smallest = .75em; # 12px
// $font-size-smaller = .8125em; # 13px
$font-size-smallest = .625em; # 10px
$font-size-smaller = .75em; # 12px
1em
等于16px
字体设置
参考:
默认NexT
使用微软雅黑字体,当前调整中文字体为思源宋体(Noto Serif SC
)
从google fonts挑选中英文字体,参考10种经典的谷歌开源英文字体,值得收藏! ,选择英文字体为Roboto
修改NexT _config.yml
# ---------------------------------------------------------------
# Font Settings
# See: https://theme-next.org/docs/theme-settings/#Fonts-Customization
# ---------------------------------------------------------------
# Find fonts on Google Fonts (https://www.google.com/fonts)
# All fonts set here will have the following styles:
# light | light italic | normal | normal italic | bold | bold italic
# Be aware that setting too much fonts will cause site running slowly
# ---------------------------------------------------------------
# To avoid space between header and sidebar in scheme Pisces / Gemini, Web Safe fonts are recommended for `global` (and `title`):
# Arial | Tahoma | Helvetica | Times New Roman | Courier New | Verdana | Georgia | Palatino | Garamond | Comic Sans MS | Trebuchet MS
# ---------------------------------------------------------------
font:
enable: false
# Uri of fonts host, e.g. //fonts.googleapis.com (Default).
host:
# Font options:
# `external: true` will load this font family from `host` above.
# `family: Times New Roman`. Without any quotes.
# `size: x.x`. Use `em` as unit. Default: 1 (16px)
# Global font settings used for all elements inside <body>.
global:
external: true
family: Lato
size:
。。。
。。。
- 设置
font enable
属性为true
- 设置
host
属性为https://fonts.loli.net
- 设置
global external
属性为true
- 设置
global family
属性为Roboto
修改/source/css/_variables/base.styl
// Font families.
// $font-family-chinese = "PingFang SC", "Microsoft YaHei";
$font-family-chinese = "Noto Serif SC"
修改/layout/partials/head/head.swig
,在最后面添加
<link href="https://fonts.googleapis.com/css?family=Noto+Serif+SC|Roboto&display=swap" rel="stylesheet">