refactored code for clarity

This commit is contained in:
juego 2014-05-14 23:20:42 +02:00
parent 19f7de9bf1
commit 7f75f13e6f

View file

@ -3,42 +3,45 @@ layout: none
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
{% if site.url != '' and
site.url | split: '/' | first != 'http:' and
site.url | split: '/' | first != 'https:'
%}
{% assign site_url = site.url | prepend: 'http:' %}
{% post_content = post.content | xml_escape | replace: site.url, url %}
{% else %}
{% assign site_url = site.url %}
{% post_content = post.content | xml_escape %}
{% endif %}
<title type="text">{{ site.title }}</title>
<generator uri="https://github.com/mojombo/jekyll">Jekyll</generator>
{% if site.url != '' and site.url | split: '/' | first != 'http:' and site.url | split: '/' | first != 'https:' %}{% assign url = site.url | prepend: 'http:' %}{% else %}{% assign url = site.url %}{% endif %}
<link rel="self" type="application/atom+xml" href="{{ url }}/feed.xml" />
<link rel="alternate" type="text/html" href="{{ url }}/" />
<link rel="self" type="application/atom+xml" href="{{ site_url }}/feed.xml" />
<link rel="alternate" type="text/html" href="{{ site_url }}/" />
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ url }}/</id>
<id>{{ site_url }}/</id>
<author>
<name>{{ site.owner.name }}</name>
<uri>{{ url }}/</uri>
<uri>{{ site_url }}/</uri>
<email>{{ site.owner.email }}</email>
</author>
{% for post in site.posts limit:20 %}
<entry>
<title type="html"><![CDATA[{{ post.title | cdata_escape }}]]></title>
<link rel="alternate" type="text/html" href="{% if post.link %}{{ post.link }}{% else %}{{ url }}{{ post.url }}{% endif %}"/>
<id>{{ url }}{{ post.id }}</id>
<link rel="alternate" type="text/html" href="{% if post.link %}{{ post.link }}{% else %}{{ site_url }}{{ post.url }}{% endif %}"/>
<id>{{ site_url }}{{ post.id }}</id>
{% if post.modified %}<updated>{{ post.modified | to_xmlschema }}T00:00:00-00:00</updated>
<published>{{ post.date | date_to_xmlschema }}</published>
{% else %}<published>{{ post.date | date_to_xmlschema }}</published>
<updated>{{ post.date | date_to_xmlschema }}</updated>{% endif %}
<author>
<name>{{ site.owner.name }}</name>
<uri>{{ url }}</uri>
<uri>{{ site_url }}</uri>
<email>{{ site.owner.email }}</email>
</author>
{% for tag in post.tags %}<category scheme="{{ url }}/tags/#{{ tag | uri_escape }}" term="{{ tag }}" />{% endfor %}
<content type="html">
{% if site.url != '' and site.url | split: '/' | first != 'http:' and site.url | split: '/' | first != 'https:' %}
{{ post.content | xml_escape | replace: site.url, url }}
{% else %}
{{ post.content | xml_escape }}
{% endif %}
&lt;p&gt;&lt;a href=&quot;{{ url }}{{ post.url }}&quot;&gt;{{ post.title }}&lt;/a&gt; was originally published by {{ site.owner.name }} at &lt;a href=&quot;{{ url }}&quot;&gt;{{ site.title }}&lt;/a&gt; on {{ post.date | date: "%B %d, %Y" }}.&lt;/p&gt;</content>
{% for tag in post.tags %}<category scheme="{{ site_url }}/tags/#{{ tag | uri_escape }}" term="{{ tag }}" />{% endfor %}
<content type="html">{{ post_content }}
&lt;p&gt;&lt;a href=&quot;{{ site_url }}{{ post.url }}&quot;&gt;{{ post.title }}&lt;/a&gt; was originally published by {{ site.owner.name }} at &lt;a href=&quot;{{ site_url }}&quot;&gt;{{ site.title }}&lt;/a&gt; on {{ post.date | date: "%B %d, %Y" }}.&lt;/p&gt;</content>
</entry>
{% endfor %}
</feed>