在Jekyll Minima(默认)主题中更改字体 [英] Changing the font in Jekyll Minima (default) theme

查看:246
本文介绍了在Jekyll Minima(默认)主题中更改字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始对Jekyll进行一些试验,并研究其工作原理。

I've started experimenting with Jekyll a little bit, and looking at how it works. So far it's a bit confusing.

首先, minima 主题属性捆绑在<$ c中$ c> gem ,并且从初始视图中隐藏。因此,我已将 minima-2.5.0 / _sss / minima.scss 复制到我创建的项目目录中,该目录应该覆盖默认配置。

First of all, the minima theme properties are bundled in a gem, and are hidden from initial view. So I've copied over minima-2.5.0/_sass/minima.scss to my created project directory, which is supposed to override the default config.

在该variabe文件中,我看到以下主要字体变量:

Inside that variabe file, I see the following main font variable:

$ base-font-family :-apple-system,BlinkMacSystemFont, Segoe UI,Roboto,Helvetica,Arial,sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol!默认值;

我太害怕碰到它了。如何在Jekyll网站上更改默认字体?为什么在这里定义了这么多的字符,以及它们如何优先于另一个?

I'm too scared to touch that. How would I change the default font in my Jekyll site? Why is there so many of them defined here, and how do they take precedence over one-another?

如果我想使用本地Ubuntu字体(如<$)怎么办? c $ c> Ubuntu mono ?
如果我想使用Inconsolata或googlefonts的其他字体怎么办?

What if I want to use a local Ubuntu font, like Ubuntu mono? What if I want to use Inconsolata or another font from googlefonts?

推荐答案

本地字体显示不一致,因为人们可能没有/未安装它们。您可以使用Google托管的免费字体(人们似乎将其称为 Google字体)。如果您想使用Ubunty Mono,请使用以下命令:

Local fonts will not display consistent, as people might not have/installed them. You can use a free font hosted by Google (which people seem to call 'Google Fonts'). If you want to use Ubunty Mono, use this:

$base-font-family: 'Ubuntu Mono', monospace;

并将其添加到您的头部:

And add this to your head:

<link href="https://fonts.googleapis.com/css?family=Ubuntu+Mono" rel="stylesheet"> 

更好的解决方案是使用下载助手

A better solution is to download the font, using a download helper.

重要提示-将公司名称放在免费向社区发布的内容的前面是不明智的(Google字体)。使用此工具创建免费服务以跟踪在线用户的行为更加不明智。大多数人称这种窃取(抄袭)和监听。我们告诉我们的孩子,这很不好。我们(作为Web开发人员)不应为此提供便利。我们不应该向访问者提供Google字体。只需下载这些免费字体,然后从您的Web服务器提供它们即可。他们(应该)与Google无关。如果您是这些字体的所有者,请阻止Google托管它们。停止促进大规模监视。谢谢。

IMPORTANT NOTE - Putting your company name in front of something that is released for free to the community is uncool (Google Fonts). Using this to create a 'free service' to track the behaviour of people online is even more uncool. Most people call this stealing (plagiary) and snooping. We tell our kids that this is bad. We (as web developers) should not facilitate this. We should NOT feed Google Fonts to our visitors. Just download these free fonts and serve them from your webserver. They (should) have nothing to do with Google. If you are the owner of any of these fonts, please prevent Google from hosting them. Stop facilitating mass surveillance. Thank you.

这篇关于在Jekyll Minima(默认)主题中更改字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆