mirror of
https://github.com/adulau/brouilleursdeblanc.git
synced 2024-11-07 12:06:26 +00:00
Merge pull request #67 from xuv/master
Verify that the site.url has a protocol in feed.xml
This commit is contained in:
commit
4b3dd0f7d7
2 changed files with 38 additions and 24 deletions
|
@ -4,6 +4,7 @@ logo: site-logo.png
|
||||||
disqus_shortname:
|
disqus_shortname:
|
||||||
search: true
|
search: true
|
||||||
# Change url to your domain. Leave localhost server or blank when working locally.
|
# Change url to your domain. Leave localhost server or blank when working locally.
|
||||||
|
# You don't need to specify the protocol if you want it available on http and https. Example: //localhost:4000
|
||||||
url: http://localhost:4000
|
url: http://localhost:4000
|
||||||
|
|
||||||
# Owner/author information
|
# Owner/author information
|
||||||
|
|
33
feed.xml
33
feed.xml
|
@ -3,35 +3,48 @@ layout: none
|
||||||
---
|
---
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
|
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
|
||||||
|
{% assign add_protocol = false %}
|
||||||
|
{% assign protocol = site.url | split: '/' | first %}
|
||||||
|
{% if site.url != '' and protocol != 'http:' and protocol != 'https:' %}
|
||||||
|
{% assign site_url = site.url | prepend: 'http:' %}
|
||||||
|
{% assign add_protocol = true %}
|
||||||
|
{% else %}
|
||||||
|
{% assign site_url = site.url %}
|
||||||
|
{% endif %}
|
||||||
<title type="text">{{ site.title }}</title>
|
<title type="text">{{ site.title }}</title>
|
||||||
<generator uri="https://github.com/mojombo/jekyll">Jekyll</generator>
|
<generator uri="https://github.com/mojombo/jekyll">Jekyll</generator>
|
||||||
<link rel="self" type="application/atom+xml" href="{{ site.url }}/feed.xml" />
|
<link rel="self" type="application/atom+xml" href="{{ site_url }}/feed.xml" />
|
||||||
<link rel="alternate" type="text/html" href="{{ site.url }}/" />
|
<link rel="alternate" type="text/html" href="{{ site_url }}/" />
|
||||||
<updated>{{ site.time | date_to_xmlschema }}</updated>
|
<updated>{{ site.time | date_to_xmlschema }}</updated>
|
||||||
<id>{{ site.url }}/</id>
|
<id>{{ site_url }}/</id>
|
||||||
<author>
|
<author>
|
||||||
<name>{{ site.owner.name }}</name>
|
<name>{{ site.owner.name }}</name>
|
||||||
<uri>{{ site.url }}/</uri>
|
<uri>{{ site_url }}/</uri>
|
||||||
<email>{{ site.owner.email }}</email>
|
<email>{{ site.owner.email }}</email>
|
||||||
</author>
|
</author>
|
||||||
{% for post in site.posts limit:20 %}
|
{% for post in site.posts limit:20 %}
|
||||||
|
|
||||||
<entry>
|
<entry>
|
||||||
<title type="html"><![CDATA[{{ post.title | cdata_escape }}]]></title>
|
<title type="html"><![CDATA[{{ post.title | cdata_escape }}]]></title>
|
||||||
<link rel="alternate" type="text/html" href="{% if post.link %}{{ post.link }}{% else %}{{ site.url }}{{ post.url }}{% endif %}"/>
|
<link rel="alternate" type="text/html" href="{% if post.link %}{{ post.link }}{% else %}{{ site_url }}{{ post.url }}{% endif %}"/>
|
||||||
<id>{{ site.url }}{{ post.id }}</id>
|
<id>{{ site_url }}{{ post.id }}</id>
|
||||||
{% if post.modified %}<updated>{{ post.modified | to_xmlschema }}T00:00:00-00:00</updated>
|
{% if post.modified %}<updated>{{ post.modified | to_xmlschema }}T00:00:00-00:00</updated>
|
||||||
<published>{{ post.date | date_to_xmlschema }}</published>
|
<published>{{ post.date | date_to_xmlschema }}</published>
|
||||||
{% else %}<published>{{ post.date | date_to_xmlschema }}</published>
|
{% else %}<published>{{ post.date | date_to_xmlschema }}</published>
|
||||||
<updated>{{ post.date | date_to_xmlschema }}</updated>{% endif %}
|
<updated>{{ post.date | date_to_xmlschema }}</updated>{% endif %}
|
||||||
<author>
|
<author>
|
||||||
<name>{{ site.owner.name }}</name>
|
<name>{{ site.owner.name }}</name>
|
||||||
<uri>{{ site.url }}</uri>
|
<uri>{{ site_url }}</uri>
|
||||||
<email>{{ site.owner.email }}</email>
|
<email>{{ site.owner.email }}</email>
|
||||||
</author>
|
</author>
|
||||||
{% for tag in post.tags %}<category scheme="{{ site.url }}/tags/#{{ tag | uri_escape }}" term="{{ tag }}" />{% endfor %}
|
{% for tag in post.tags %}<category scheme="{{ site_url }}/tags/#{{ tag | uri_escape }}" term="{{ tag }}" />{% endfor %}
|
||||||
<content type="html">{{ post.content | xml_escape }}
|
<content type="html">
|
||||||
<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></content>
|
{% if add_protocol %}
|
||||||
|
{{ post.content | xml_escape | replace: site.url, site_url }}
|
||||||
|
{% else %}
|
||||||
|
{{ post.content | xml_escape }}
|
||||||
|
{% endif %}
|
||||||
|
<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></content>
|
||||||
</entry>
|
</entry>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</feed>
|
</feed>
|
||||||
|
|
Loading…
Reference in a new issue