Pelican static site generator change fontsize

痴心易碎 提交于 2019-12-09 23:50:43

问题


Dose anyone can give me a hint on how to change the fontsize with CSS for a Pelican Site. I use the pelican-bootstrap3 theme.

I do not want to fork and modify the Theme. I would like to change the size with the custom.css feature.

thanks for the help mathias


回答1:


Check out the pelican-bootstrap-3 help page on github.

What you can do is make a custom.css file that looks like this:

html {
   font-size:150%
}

The trick is putting your custom.css file in your content folder and telling pelican where it is and then where it should be put in your output. You must also tell the pelican-bootstrap-3 theme where this file is and it will add it to the headers in your rendered output.

First, generally you would make a folder called extras in your content folder and put your custom.css file in there. This is where the path notation on the github page comes in:

extras/custom.css

You must now edit your pelicanconf.py file to tell pelican where this file is located, and also to give this information to pelican-bootstrap-3. Add this to yours:

# 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'


来源:https://stackoverflow.com/questions/29986711/pelican-static-site-generator-change-fontsize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!