Skip to content

Commit

Permalink
feat(template): update base urls for feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
sparanoid committed Oct 31, 2015
1 parent 64ee055 commit 3c13efe
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions _app/_includes/_amsf.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{% comment %}
Feed URL
{% endcomment %}
{% capture amsf_feed_url %}{{ site.feed | prepend: site.base }}{% endcapture %}
{% capture amsf_feed_url %}{{ site.feed | prepend: site.base | replace: '/index.xml', '/' }}{% endcapture %}

{% comment %}
Page title
Expand All @@ -71,7 +71,7 @@
{% comment %}
Page URL
{% endcomment %}
{% capture amsf_page_url %}{{ page.url | prepend: amsf_site_base }}{% endcapture %}
{% capture amsf_page_url %}{{ page.url | prepend: amsf_site_base | replace: '/index.html', '/' | replace: '/index.htm', '/' | replace: '/index.xml', '/' }}{% endcapture %}

{% comment %}
Page type (used by Open Graph)
Expand Down
4 changes: 2 additions & 2 deletions _app/feed-atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ permalink: /feed.xml
<title>{{ site.name }}</title>
<subtitle>{{ site.description }}</subtitle>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.feed | prepend: amsf_site_base | xml_escape }}</id>
<id>{{ amsf_site_base | xml_escape }}/</id>
<rights>Copyright © {{ site.time | date: "%Y" }}, {{ site.data.authors.default.name }}</rights>

<link rel="alternate" type="text/html" hreflang="en" href="{{ amsf_site_base }}/" />
<link rel="self" type="application/atom+xml" href="{{ site.feed | prepend: amsf_site_base }}" />
<link rel="self" type="application/atom+xml" href="{{ amsf_page_url }}" />

<author>
<name>{{ site.data.authors.default.name }}</name>
Expand Down
2 changes: 1 addition & 1 deletion _app/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% for page in site.html_pages %}
{% if page.hidden != true %}
<url>
<loc>{{ page.url | replace:'/index.html', '/' | prepend: amsf_site_base }}</loc>
<loc>{{ page.url | prepend: amsf_site_base | replace: '/index.html', '/' }}</loc>
{% if page.last_modified_at %}
<lastmod>{{ page.last_modified_at | date: "%F" }}</lastmod>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion _config.init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ base: null
# Default: /assets
assets: /assets

# Define feed path. If you use `/feed/index.xml` as feed permalink, `{{ page.url }}` won't pass feed validation with "Self reference doesn't match document location" error
# Define your main feed URL, this will be only used in your templates
# Default: /feed.xml
feed: /feed.xml

Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ base: /lab/amsf
# Default: /assets
assets: /assets

# Define feed path. If you use `/feed/index.xml` as feed permalink, `{{ page.url }}` won't pass feed validation with "Self reference doesn't match document location" error
# Define your main feed URL, this will be only used in your templates
# Default: /feed.xml
feed: /feed.xml

Expand Down

0 comments on commit 3c13efe

Please sign in to comment.