首页 > 解决方案 > 修改 blogdown webst 的 font-title

问题描述

大家好,这是我关于博客的第一个问题。我想对博客标题进行基本更改。

该博客来自此链接:

一辉

这是 .toml 文件:

baseurl = "/"
languageCode = "en-us"
title = "This is the Title I want Change"
theme = "hugo-xmag"
googleAnalytics = ""
disqusShortname = ""
ignoreFiles = ["\\.Rmd$", "_files$", "_cache$"]
preserveTaxonomyNames = true
footnotereturnlinkcontents = "↩"
hasCJKLanguage = true
enableEmoji = true
paginate = 6

[permalinks]
    post = "/post/:year/:month/:day/:slug/"

[[menu.main]]
    name = "Home"
    url = "/"
    weight = 1
[[menu.main]]
    name = "About"
    url = "/about/"
    weight = 2
[[menu.main]]
    name = "Categories"
    url = "/categories/"
    weight = 3
[[menu.main]]
    name = "Tags"
    url = "/tags/"
    weight = 4
[[menu.main]]
    name = "Subscribe"
    url = "/index.xml"

[params]
    description = "A website built through Hugo and blogdown."
    summary_length = 300
    github_edit = "https://github.com/yihui/hugo-xmag/edit/master/exampleSite/content/"
    footer = "© [Yihui Xie](https://yihui.name) 2017 | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)"

[params.text]
    back = "← Back to Home"
    edit = "Edit this page →"
    truncated = "…"

在网站上说 Blackletter 中的杂志标题 (ℭ ℜ) 但我在 .css 文件中找不到与这种字体相关的任何内容。这是我想改变的字体。

请问有什么帮助吗?

只是一个想法会很好。

谢谢

标签: htmlcssr-markdownblogdown

解决方案


Yihui 使用了一些正则表达式黑魔法将标题转换为 Math 粗体 Fraktur。因此,它不受 CSS 字体设置的控制。

你可以在这里找到它:

将其更改为另一种字体。将行修改为

{{ else }}<div class="yourfancytitle"> {{ .Site.Title }} </div>                                                                    

然后在您的 CSS 中,更改字体系列:

.yourfancytitle{
  font-family: Candara;
}                                                                                          

推荐阅读