Pelican 静态站点生成器更改字体大小

mgi*_*aco 2 twitter-bootstrap bootswatch pelican

任何人都可以给我一个关于如何使用 CSS 更改 Pelican 网站的字体大小的提示。我使用 pelican-bootstrap3 主题。

我不想分叉和修改主题。我想使用 custom.css 功能更改大小。

感谢马蒂亚斯的帮助

Ada*_*ale 5

查看github上的 pelican-bootstrap-3 帮助页面。

您可以做的是创建一个如下所示的 custom.css 文件:

html {
   font-size:150%
}
Run Code Online (Sandbox Code Playgroud)

诀窍是将您的 custom.css 文件放在您的内容文件夹中,并告诉 pelican 它在哪里,然后它应该放在输出中的位置。您还必须告诉 pelican-bootstrap-3 主题该文件的位置,它会将其添加到渲染输出的标题中。

首先,通常您会在内容文件夹中创建一个名为 extras 的文件夹,并将 custom.css 文件放入其中。这就是 github 页面上的路径符号的用处:

extras/custom.css
Run Code Online (Sandbox Code Playgroud)

您现在必须编辑pelicanconf.py文件以告诉 pelican 该文件所在的位置,并将此信息提供给 pelican-bootstrap-3。将其添加到您的:

# tell pelican where your custom.css file is in your content folder
STATIC_PATHS = ['extras/custom.css']

# tell pelican where it should copy that file to in your output folder
EXTRA_PATH_METADATA = {
'extras/custom.css': {'path': 'static/custom.css'}
}

# tell the pelican-bootstrap-3 theme where to find the custom.css file in your output folder
CUSTOM_CSS = 'static/custom.css'
Run Code Online (Sandbox Code Playgroud)