我使用 Octopress 和 coogie 的名为 Oscailte 的主题创建了一个新博客。不过我遇到了一些麻烦。我为博客添加了标题,所有页面都提取了正确的页面标题,但着陆页除外,它提取的是默认标题 - “这是您主页的标题”。
_config.yml 中的代码:
title: TheHopefulWebDev
subtitle: TheHopefulWebDev
author: Joseph Sawyer
simple_search: http://google.com/search
description: TheHopefulWebDev
/source/_includes/custom/header.html 中的代码
<div class="grid__item two-fifths lap-four-sixths palm-one-whole">
<a href="{{ root_url }}/" class="site-title">{{ site.title }}</a>
</div>
这显示正确。所以我不明白为什么它没有在着陆页上为网站本身提取正确的标题。
感谢任何帮助。
编辑:我应该补充一点,它在浏览器标题栏中显示的完整标题是“这是您主页的标题 -- TheHopefulWebDev”。尝试从/_deploy/index.html 中删除“This is the title..”位,现在显示为:
<title>TheHopefulWebDev</title>
关闭服务器,使用 rake 预览重新启动,仍然得到相同的标题。 :/
最佳答案
想通了。必须在顶部编辑/source/_layouts/default.html:
---
title: Main
---
现在标题栏显示“Main - The Hopeful Web Dev”
希望对大家有帮助。
关于html - Octopress site.title 没有改变?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20535846/