protocol agnostic url

This commit is contained in:
juego 2014-05-14 23:28:46 +02:00
parent 7f75f13e6f
commit 987f541013
2 changed files with 18 additions and 20 deletions

View file

@ -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

View file

@ -3,15 +3,12 @@ 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">
{% if site.url != '' and {% if site.url != '' and site.url | split: '/' | first != 'http:' and site.url | split: '/' | first != 'https:' %}
site.url | split: '/' | first != 'http:' and
site.url | split: '/' | first != 'https:'
%}
{% assign site_url = site.url | prepend: 'http:' %} {% assign site_url = site.url | prepend: 'http:' %}
{% post_content = post.content | xml_escape | replace: site.url, url %} {% assign post_content = post.content | xml_escape | replace: site.url, url %}
{% else %} {% else %}
{% assign site_url = site.url %} {% assign site_url = site.url %}
{% post_content = post.content | xml_escape %} {% assign post_content = post.content | xml_escape %}
{% endif %} {% 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>