Jekyll 站点地图排除不起作用
Jekyll sitemap exclude not working
我想知道为什么 main.css
仍然出现在我的最终 sitemap.xml
中。
我没有使用任何站点地图插件 in _config.yml
.
在/sitemap.xml
的代码中,它说:
{% for page in site.pages %}
{% unless page.sitemap.exclude == "yes" %}
所以我在 /css/main.scss
之上添加了以下内容:
---
sitemap:
exclude: yes
---
仍然 main.css
出现在 /_site/sitemap.xml
有什么想法吗?
在yaml表达式page.sitemap.exclude
中,exclude
是sitemap
的child。
反映父母身份的正确缩进是:
---
sitemap:
exclude: "yes"
---
我在 sitemap.xml
中通过额外检查 page.title
:
解决了这个问题
{% for page in site.pages %}
{% if page.title %}
<url>
<loc>{{ site.url }}{{ page.url }}</loc>
</url>
{% endif %}
{% endfor %}
我想知道为什么 main.css
仍然出现在我的最终 sitemap.xml
中。
我没有使用任何站点地图插件 in _config.yml
.
在/sitemap.xml
的代码中,它说:
{% for page in site.pages %}
{% unless page.sitemap.exclude == "yes" %}
所以我在 /css/main.scss
之上添加了以下内容:
---
sitemap:
exclude: yes
---
仍然 main.css
出现在 /_site/sitemap.xml
有什么想法吗?
在yaml表达式page.sitemap.exclude
中,exclude
是sitemap
的child。
反映父母身份的正确缩进是:
---
sitemap:
exclude: "yes"
---
我在 sitemap.xml
中通过额外检查 page.title
:
{% for page in site.pages %}
{% if page.title %}
<url>
<loc>{{ site.url }}{{ page.url }}</loc>
</url>
{% endif %}
{% endfor %}