Permalink
Browse files

Use liveurl

Changing this config variable name prevents the redirect_from plugin
from creating absolute URL redirects that point to the live site.
  • Loading branch information...
mdlincoln committed May 19, 2018
1 parent 2fdbdc0 commit c4ee8761d26c14fedb3f9a7a380985d0d5bd3df8
Showing with 12 additions and 11 deletions.
  1. +2 −1 _config.yml
  2. +2 −2 _includes/feed-item.html
  3. +1 −1 _includes/metadata.html
  4. +2 −2 _includes/twitter-card.html
  5. +1 −1 _layouts/lesson.html
  6. +4 −4 feed.xml
@@ -1,6 +1,7 @@
name: Programming Historian
description: Introductory and intermediate programming lessons for humanists
url: https://programminghistorian.org
# Used to insert the live url of the site in places that require a full link such as suggested citations and XML feed
liveurl: https://programminghistorian.org
baseurl: ""
permalink: :categories/:title
exclude:
@@ -10,6 +10,6 @@
{% else %}
<pubDate>{{ page.translation_date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
{% endif %}
<link>{{ site.url }}{{ page.url }}</link>
<guid isPermaLink="true">{{ site.url }}{{ page.url }}</guid>
<link>{{ site.liveurl }}{{ page.url }}</link>
<guid isPermaLink="true">{{ site.liveurl }}{{ page.url }}</guid>
</item>
@@ -10,4 +10,4 @@
{% endfor %}
<meta name="citation_publication_date" content="{{ page.date }}" />
<meta name="citation_journal_title" content="{{ site.name }}" />
<meta name="citation_public_url" content="{{ site.url }}{{ page.url }}" />
<meta name="citation_public_url" content="{{ site.liveurl }}{{ page.url }}" />
@@ -11,11 +11,11 @@
{% endif %}

{% if page.lang == "en" %}
<meta name="twitter:image" content="{{ site.url }}/gallery/{{ page.url | remove_first:'/lessons/' }}.png" />
<meta name="twitter:image" content="{{ site.liveurl }}/gallery/{{ page.url | remove_first:'/lessons/' }}.png" />
{% endif %}

{% if page.lang == "es" %}
<meta name="twitter:image" content="{{ site.url }}/gallery/{{ page.redirect_from | remove_first:'/es/lessons/' }}.png" />
<meta name="twitter:image" content="{{ site.liveurl }}/gallery/{{ page.redirect_from | remove_first:'/es/lessons/' }}.png" />
{% endif %}


@@ -214,7 +214,7 @@ <h2>{{ site.data.snippets.retired[page.lang] }}</h2>

<h5 class="suggested-citation-header">{{ site.data.snippets.suggested-citation[page.lang] }}</h5>
<div class="suggested-citation-text">
<p class="suggested-citation-text">{% include author.html %}, {{ site.data.snippets.title-open-quote[page.lang] }}{{ page.title | strip }}{{ site.data.snippets.title-close-quote[page.lang] }}{% if page.translator %} {{ site.data.snippets.translator[page.lang] }} {{ page.translator | array_to_sentence_string: site.data.snippets.and[page.lang] }},{% endif %} <em>{{ site.data.snippets.journal-title[page.lang] }}</em> {{ vol_no }} ({{ page_year }}), {{ site.url }}{{ page.url }}.</p>
<p class="suggested-citation-text">{% include author.html %}, {{ site.data.snippets.title-open-quote[page.lang] }}{{ page.title | strip }}{{ site.data.snippets.title-close-quote[page.lang] }}{% if page.translator %} {{ site.data.snippets.translator[page.lang] }} {{ page.translator | array_to_sentence_string: site.data.snippets.and[page.lang] }},{% endif %} <em>{{ site.data.snippets.journal-title[page.lang] }}</em> {{ vol_no }} ({{ page_year }}), {{ site.liveurl }}{{ page.url }}.</p>
</div>
</div>
</div>
@@ -6,8 +6,8 @@
<channel>
<title>{{ site.name | xml_escape }}</title>
<description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description>
<link>{{ site.url }}</link>
<atom:link href="{{ site.url }}/feed.xml" rel="self" type="application/rss+xml" />
<link>{{ site.liveurl }}</link>
<atom:link href="{{ site.liveurl }}/feed.xml" rel="self" type="application/rss+xml" />
{% for post in site.posts limit:10 %}
<item>
<title>{{ post.title | xml_escape }}</title>
@@ -20,8 +20,8 @@
<description>{{ post.content | xml_escape }}</description>
{% endif %}
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
<link>{{ site.url }}{{ post.url }}</link>
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
<link>{{ site.liveurl }}{{ post.url }}</link>
<guid isPermaLink="true">{{ site.liveurl }}{{ post.url }}</guid>
</item>
{% endfor %}

0 comments on commit c4ee876

Please sign in to comment.