假设你的jekyll站点有标准的结构:
|-- _layouts
| |-- default.html
| |-- post.html
|-- _includes
|-- _posts
| |-- 1970-01-01-placeholder-post.md
|-- index.html
改下模版文件default.html
在主样式引用代码下面增加已下代码Liquid 代码:
{% if page.style %}
<style type="text/css">
{{ page.style }}
</style>
{% endif %}
在文章页中添加自定义的style变量
---
layout: post
title: Placeholder post
style: |
body {
background: HoneyDew;
}
---
Your post content