【发布时间】:2016-07-19 20:50:28
【问题描述】:
我正在尝试使用 Jekyll 使用我的某些博客文章创建有效的播客提要。但是我在 Jekyll 更改某些 xml 标签的大小写和格式时遇到了麻烦
这是我为每个提要item 提供的模板:
{% for post in site.posts %}
{% if post.layout == "podcast" %}
<item>
<title>{{post.title}}</title>
<description>
{{post.title}}
{{ post.overview | xml_escape}}
</description>
<content:encoded>
{{post.title}}<br />
{{ post.overview | xml_escape}}<br />
{{ post.content }}
</content:encoded>
<guid>{{ site.url }}{{ post.url }}</guid>
<link>{{ site.url }}{{ post.url }}</link>
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S GMT" }}</pubDate>
<itunes:image href="{{ site.url }}{{ post.thumb }}" />
<enclosure url="{{ post.mp3link }}" length="{{ post.length }}" type="audio/mpeg" />
</item>
{% endif %}
{% endfor %}
相关部分是这两个标签:
<link>{{ post.url }}</link>
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S GMT" }}</pubDate>
在输出中,它们的输出如下:
<link />http://www.example.com/
<pubdate>Fri, 30 Oct 2015 00:00:00 GMT</pubdate>
链接似乎被格式化为 html 的 head 部分中的 link 标记,并且 pubDate 不再是驼峰式大小写,因此根据 rss 标准无效:https://validator.w3.org/feed/docs/rss2.html#hrelementsOfLtitemgt
是否需要传递某种标志或缺少某些功能?
其他标签正在处理中(图像、附件、guid 等)。
我正在使用:
- 杰基尔 2.5.3
- 红宝石 1.9.3p484
- Linux Mint 17
【问题讨论】: