Xml 如何将永久链接添加到Jekyll RSS源?

Xml 如何将永久链接添加到Jekyll RSS源?,xml,rss,jekyll,Xml,Rss,Jekyll,my Jekyll RSS提要的一些帖子是链接帖子(单击标题后,它们会将读者转发到外部源URL)。我在feed.xml中为它们设置了一个{%if post.link%}液体过滤器 我想要的是显示一个“∞ Permalink”位于RSS源中链接帖子的底部 我的问题:是否有办法在feed.xml文件中每个链接帖子的底部显示永久链接 作为一种解决方法,我可以在帖子内容区域的底部设置一个额外的永久链接,但是它也会显示在帖子中,所以我想知道是否有更直接的方法 更新:我尝试设置一个单独的永久链接,如下所示:

my Jekyll RSS提要的一些帖子是链接帖子(单击标题后,它们会将读者转发到外部源URL)。我在
feed.xml
中为它们设置了一个
{%if post.link%}
液体过滤器

我想要的是显示一个“∞ Permalink”位于RSS源中链接帖子的底部

我的问题:是否有办法在feed.xml文件中每个链接帖子的底部显示永久链接

作为一种解决方法,我可以在帖子内容区域的底部设置一个额外的永久链接,但是它也会显示在帖子中,所以我想知道是否有更直接的方法

更新:我尝试设置一个单独的永久链接,如下所示:

<a title="Permalink" class="permalink" href="{{ site.domain }}{{ page.url }}">∞ Permalink</a>
有人知道如何将链接附加到内容标签吗

这是my feed.xml-如果这有帮助的话:

---
layout: none
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>{{ site.name }}</title>
    <description>{{ site.description }}</description>
    <link>{{ site.url }}</link>
    <atom:link href="{{ site.url }}/feed.links.xml" rel="self" type="application/rss+xml" />
    {% for post in site.posts limit:30 %}
      {% if post.link %}
      <item>
        <title>Link:{{ post.title }}</title>
        <description>{{ post.content | xml_escape }}</description>
        <pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
        <link>{{ post.link | escape }}</link>
        <guid isPermaLink="true">{{ post.link }}</guid>
      </item>

      {% else %}

      {% unless post.link %}
      <item>
        <title>{{ post.title }}</title>
        <description>{{ post.content | xml_escape }}</description>
        <pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
        <link>{{ site.url }}{{ post.url }}</link>
        <guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
      </item>
      {% endunless %}

      {% endif %}

    {% endfor %}
  </channel>
</rss>
---
布局:无
---
{{site.name}
{{site.description}}
{{site.url}
{站点中的帖子的百分比。帖子限制:30%}
{%if post.link%}
链接:{post.title}
{{post.content | xml_escape}}
{{post.date | date:“%a,%d%b%Y%H:%M:%S%z”}
{{post.link | escape}}
{{post.link}
{%else%}
{%除非是post.link%}
{{post.title}}
{{post.content | xml_escape}}
{{post.date | date:“%a,%d%b%Y%H:%M:%S%z”}
{{site.url}}{{post.url}}
{{site.url}}{{post.url}}
{%end除非%}
{%endif%}
{%endfor%}

将其添加到rss文件中相应的
标记中。不要忘记,这是一个包含HTML的XML文档,因此必须对HTML内容进行XML转义:

<description>
    {{ post.content | xml_escape }}
    &lt;a title=&quot;Permalink&quot; class=&quot;permalink&quot; href=&quot;{{ site.domain | xml_escape }}{{ post.url | xml_escape }}&quot;&gt;
        ∞ Permalink
    &lt;/a&gt;
</description>

{{post.content | xml_escape}}
a title=“Permalink”class=“Permalink”href=“{{site.domain | xml_escape}}{{post.url | xml_escape}}”
∞ Permalink
/a

这通常被认为是糟糕的形式。大多数(每个?)读者都会从
元素向您的内容添加链接。内容本身应该只是内容,不包括元数据。
<description>
    {{ post.content | xml_escape }}
    &lt;a title=&quot;Permalink&quot; class=&quot;permalink&quot; href=&quot;{{ site.domain | xml_escape }}{{ post.url | xml_escape }}&quot;&gt;
        ∞ Permalink
    &lt;/a&gt;
</description>