From 7f75f13e6f63020bd1e483d7969269e670a254ca Mon Sep 17 00:00:00 2001 From: juego Date: Wed, 14 May 2014 23:20:42 +0200 Subject: [PATCH] refactored code for clarity --- feed.xml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/feed.xml b/feed.xml index 7925584..8958714 100644 --- a/feed.xml +++ b/feed.xml @@ -3,42 +3,45 @@ layout: none --- +{% 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 %} {{ site.title }} - Jekyll -{% 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 %} - - + + {{ site.time | date_to_xmlschema }} -{{ url }}/ +{{ site_url }}/ {{ site.owner.name }} - {{ url }}/ + {{ site_url }}/ {{ site.owner.email }} {% for post in site.posts limit:20 %} <![CDATA[{{ post.title | cdata_escape }}]]> - - {{ url }}{{ post.id }} + + {{ site_url }}{{ post.id }} {% if post.modified %}{{ post.modified | to_xmlschema }}T00:00:00-00:00 {{ post.date | date_to_xmlschema }} {% else %}{{ post.date | date_to_xmlschema }} {{ post.date | date_to_xmlschema }}{% endif %} {{ site.owner.name }} - {{ url }} + {{ site_url }} {{ site.owner.email }} - {% for tag in post.tags %}{% endfor %} - - {% 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 %} - <p><a href="{{ url }}{{ post.url }}">{{ post.title }}</a> was originally published by {{ site.owner.name }} at <a href="{{ url }}">{{ site.title }}</a> on {{ post.date | date: "%B %d, %Y" }}.</p> + {% for tag in post.tags %}{% endfor %} + {{ post_content }} + <p><a href="{{ site_url }}{{ post.url }}">{{ post.title }}</a> was originally published by {{ site.owner.name }} at <a href="{{ site_url }}">{{ site.title }}</a> on {{ post.date | date: "%B %d, %Y" }}.</p> {% endfor %}