jekyll主页标题为空

jekyll主页标题为空,jekyll,liquid,Jekyll,Liquid,当前有一个空的标题标签,如 我在中定义了title,并且正在使用中的页面。title 如何获取要渲染的标题?您可以在索引中使用站点标题 <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title> {%if page.title%}{{page.title}}{%else%}{{site.title}}{%endif%} 并在_config.yml文件中

当前有一个空的标题标签,如

我在中定义了
title
,并且正在使用中的
页面。title


如何获取要渲染的标题?

您可以在索引中使用站点标题

<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
{%if page.title%}{{page.title}}{%else%}{{site.title}}{%endif%}

并在_config.yml文件中定义网站标题。

谢谢,你知道为什么索引首页不能作为
页面使用。标题
?首页在索引中能起作用吗?我不知道,但是在indexI中使用站点的前端内容是有意义的,比如将标题与内容放在同一个文件中。在config
defaults
中定义
标题
作为
页面。标题