更改Hugo主题中的字体

时间:2018-03-13 04:06:55

标签: css themes hugo

Hugo和css的新手。尝试根据这些说明更改beautifulhugo主题的字体:

见Chandra的11月17日帖子: https://discourse.gohugo.io/t/font-selection-in-theme/8803/8

我已经下载了两种字体并将它们放在静态/字体

在config.toml

中添加了以下内容
googlefonts = “http://fonts.googleapis.com/css?family=Itim|Limelight”

将此添加到static / css / custom_style.css

body {
font-family: ‘Limelight’, cursive;
}
p {
font-family: ‘Itim’, cursive;
}

并将其添加到layouts / partials / head_custom.html

 {{ if .Site.Params.googlefonts }}
 <link rel="stylesheet" href="{{ .Site.Params.googlefonts }}" type="text/css" media="all" /> 
 {{ end }}

但是,没有任何变化可见。请告知我的错误。

这里应该有所有内容:https://github.com/ixodid198/blog

2 个答案:

答案 0 :(得分:0)

你说:

  

我已经下载了两种字体并将它们放在静态/字体

如果使用谷歌字体,为什么要这样做?

无论如何,您是否尝试删除http:表单googlefonts = “http://fonts.googleapis.com/css?family=Itim|Limelight”

你的代码中可能有一些东西会覆盖你的字体设置。

如果您可以将您的网站放在网上某个位置以便我们检查发生了什么,那将会很有帮助。

答案 1 :(得分:0)

在config.toml中,添加

debugPrint

不确定这是否通常适用于所有主题,但适用于the theme I'm using

相关问题