Github Pages 和 Jekyll 不匹配
Github Pages and Jekyll Do Not Match
我刚刚使用 Jekyll 创建了 github 页面,但在 _config.yml
和我的 github 页面之间它不匹配。我的错误在哪里?
其实有一些错误(不匹配),但是作为例子请看两处的标题。从 _config.yml
起,我将 "ABAYblablabla | Indonesian Developer Wannabe" 作为标题。但是在 github 上它会引发 "About Me"。有人可以帮我在 GitHub 页面和源代码之间进行调整吗?
配置https://github.com/abaykan/abaykan.github.io/blob/master/_config.yml
Github 页数 https://abaykan.github.io/
Sorry, i'm using google translate. My English is messed up.
你的 index.md 前面没有 title: my page title
,Github Pages 正在从 html headers。当它找到 <h1>About Me</h1>
时,它会将 index.md 标题设置为 "About Me".
然后你有 _layout/default.html 这样设置页面标题:
{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}
这意味着它打印 page.title
或 site.title
,而不是两者。
如果你想打印 site.title
并且最终 page.title
,你可以这样做:
{{ site.title }}{% if page.title %} - {{ page.title }}{% endif %}
我刚刚使用 Jekyll 创建了 github 页面,但在 _config.yml
和我的 github 页面之间它不匹配。我的错误在哪里?
其实有一些错误(不匹配),但是作为例子请看两处的标题。从 _config.yml
起,我将 "ABAYblablabla | Indonesian Developer Wannabe" 作为标题。但是在 github 上它会引发 "About Me"。有人可以帮我在 GitHub 页面和源代码之间进行调整吗?
配置https://github.com/abaykan/abaykan.github.io/blob/master/_config.yml
Github 页数 https://abaykan.github.io/
Sorry, i'm using google translate. My English is messed up.
你的 index.md 前面没有 title: my page title
,Github Pages 正在从 html headers。当它找到 <h1>About Me</h1>
时,它会将 index.md 标题设置为 "About Me".
然后你有 _layout/default.html 这样设置页面标题:
{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}
这意味着它打印 page.title
或 site.title
,而不是两者。
如果你想打印 site.title
并且最终 page.title
,你可以这样做:
{{ site.title }}{% if page.title %} - {{ page.title }}{% endif %}