Skip to content

Commit

Permalink
use relative_url filter in minima
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Oct 6, 2016
1 parent 84bc261 commit c5f1213
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
8 changes: 3 additions & 5 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">

{% assign custom_url = site.url | append: site.baseurl %}
{% assign full_base_url = custom_url | default: site.github.url %}
<link rel="stylesheet" href="{{ "/assets/main.css" | prepend: full_base_url }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: full_base_url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ "/feed.xml" | prepend: full_base_url }}">
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | relative_url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ "/feed.xml" | relative_url }}">

{% if jekyll.environment == 'production' and site.google_analytics %}
{% include google-analytics.html %}
Expand Down
6 changes: 2 additions & 4 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

<div class="wrapper">

{% assign custom_url = site.url | append: site.baseurl %}
{% assign full_base_url = custom_url | default: site.github.url %}
<a class="site-title" href="{{ full_base_url }}/">{{ site.title | escape }}</a>
<a class="site-title" href="{{ "/" | relative_url}}">{{ site.title | escape }}</a>

<nav class="site-nav">
<span class="menu-icon">
Expand All @@ -18,7 +16,7 @@
<div class="trigger">
{% for my_page in site.pages %}
{% if my_page.title %}
<a class="page-link" href="{{ my_page.url | prepend: full_base_url }}">{{ my_page.title | escape }}</a>
<a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
{% endif %}
{% endfor %}
</div>
Expand Down
7 changes: 2 additions & 5 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@ <h1 class="page-heading">Posts</h1>

{{ content }}

{% assign custom_url = site.url | append: site.baseurl %}
{% assign full_base_url = custom_url | default: site.github.url %}

<ul class="post-list">
{% for post in site.posts %}
<li>
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>

<h2>
<a class="post-link" href="{{ post.url | prepend: full_base_url }}">{{ post.title | escape }}</a>
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
</h2>
</li>
{% endfor %}
</ul>

<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: full_base_url }}">via RSS</a></p>
<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</a></p>

</div>

0 comments on commit c5f1213

Please sign in to comment.