Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix relative assets #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />

<link rel="shortcut icon" href="{{ site.baseurl }}assets/images/favicon.ico">
<link rel="shortcut icon" href="{{ "assets/images/favicon.ico" | relative_url }}">
<meta http-equiv="cleartype" content="on">

<link rel="stylesheet" type='text/css' href='//fonts.googleapis.com/css?family=Open+Sans:400,300,700'>
<link rel="stylesheet" href="{{ site.baseurl }}assets/css/ghost.min.css" />
<link rel="stylesheet" href="{{ "assets/css/ghost.min.css" | relative_url }}" />
</head>
<body>
<main role="main" id="main">
Expand All @@ -33,12 +33,12 @@
<section class="error-details">
<img
class="error-ghost"
src="{{ site.baseurl }}assets/images/404.png"
srcset="{{ site.baseurl }}assets/images/404.png"/>
src="{{ "assets/images/404.png" | relative_url }}"
srcset="{{ "assets/images/404.png" | relative_url }}"/>
<section class="error-message">
<h1 class="error-code">404</h1>
<h2 class="error-description">Page not found</h2>
<a class="error-link" href="{{ site.baseurl }}">Go to the front page →</a>
<a class="error-link" href="{{ "/" | relative_url }}">Go to the front page →</a>
</section>
</section>
</section>
Expand All @@ -50,4 +50,4 @@ <h2 class="error-description">Page not found</h2>
<!-- Add Google Analytics -->
{% include analytics.html %}
</body>
</html>
</html>
6 changes: 3 additions & 3 deletions _includes/author_pagination.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<nav class="pagination" role="pagination">
{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
<a class="newer-posts" href="{{ site.baseurl }}author/{{ page.author }}" title="Previous Page">&laquo; Newer Posts</a>
<a class="newer-posts" href="{{ "author/" | append: page.author | relative_url }}" title="Previous Page">&laquo; Newer Posts</a>
{% else %}
<a class="newer-posts" href="{{ site.baseurl }}author/{{ page.author }}/page{{ paginator.previous_page }}/" title="Previous Page">&laquo; Newer Posts</a>
<a class="newer-posts" href="{{ "author/" | append: page.author | append: "/page" | append: paginator.previous_page | relative_url }}" title="Previous Page">&laquo; Newer Posts</a>
{% endif %}
{% endif %}
<span class="page-number"> Page {{ paginator.page }} of {{ paginator.total_pages }} </span>
{% if paginator.next_page %}
<a class="older-posts" href="{{ site.baseurl }}author/{{ page.author }}/page{{ paginator.next_page }}/" title="Next Page">Older Posts &raquo;</a>
<a class="older-posts" href="{{ "author/" | append: page.author | append: "/page" | append: paginator.next_page | relative_url }}" title="Next Page">Older Posts &raquo;</a>
{% endif %}
</nav>
18 changes: 9 additions & 9 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<link rel="canonical" href="{{ site.url }}{% if site.baseurl %}{{ site.baseurl }}{% endif %}{{ page.url }}" />
<link rel="canonical" href="{{ page.url | absolute_url }}" />
<meta name="referrer" content="origin" />
<link rel="next" href="{{ site.baseurl }}page2/" />
<link rel="next" href="{{ "page2" | relative_url }}" />

<meta property="og:site_name" content="{{ site.name }}" />
<meta property="og:type" content="website" />
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.name }}{% endif %}" />
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}" />
<meta property="og:url" content="{{ site.url }}{% if site.baseurl %}{{ site.baseurl }}{% endif %}{{ page.url }}" />
<meta property="og:image" content="{{ site.baseurl }}{% if page.cover %}{{ page.cover }}{% else %}assets/images/cover1.jpg{% endif %}" />
<meta property="og:url" content="{{ page.url | absolute_url }}" />
<meta property="og:image" content="{% if page.cover %}{{ page.cover | absolute_url }}{% else %}{{ "assets/images/cover1.jpg" | absolute_url }}{% endif %}" />

<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.name }}{% endif %}" />
<meta name="twitter:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}" />
<meta name="twitter:url" content="{{ site.url }}{% if site.baseurl %}{{ site.baseurl }}{% endif %}{{ page.url }}" />
<meta name="twitter:image:src" content="{{ site.baseurl }}{% if page.cover %}{{ page.cover }}{% else %}assets/images/cover1.jpg{% endif %}" />
<meta name="twitter:url" content="{{ page.url | absolute_url }}" />
<meta name="twitter:image:src" content="{% if page.cover %}{{ page.cover | absolute_url }}{% else %}{{ "assets/images/cover1.jpg" | absolute_url }}{% endif %}" />

<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Website",
"publisher": "{{ site.name }}",
"name": "{% if page.title %}{{ page.title }}{% else %}{{ site.name }}{% endif %}",
"url": "{{ site.url }}{% if site.baseurl %}{{ site.baseurl }}{% endif %}{{ page.url }}",
"image": "{{ site.baseurl }}{% if page.cover %}{{ page.cover }}{% else %}assets/images/cover1.jpg{% endif %}",
"url": "{{ page.url | absolute_url }}",
"image": "{% if page.cover %}{{ page.cover | absolute_url }}{% else %}{{ "assets/images/cover1.jpg" | absolute_url }}{% endif %}",
"description": "{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}"
}
</script>

<meta name="generator" content="Jekyll 3.0.0" />
<link rel="alternate" type="application/rss+xml" title="{{ site.name }}" href="{{ site.baseurl }}feed.xml" />
<link rel="alternate" type="application/rss+xml" title="{{ site.name }}" href="{{ "feed.xml" | relative_url }}" />
12 changes: 6 additions & 6 deletions _includes/loop.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
{% for post in paginator.posts %}
<article class="post">
<header class="post-header">
<h2 class="post-title"><a href="{{ site.baseurl }}{{ post.url | remove: '/' }}">{{ post.title }}</a></h2>
<h2 class="post-title"><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h2>
</header>
<section class="post-excerpt">
<p>{{ post.content | strip_html | truncatewords: 26 }} <a class="read-more" href="{{ site.baseurl }}{{ post.url | remove: '/' }}">&raquo;</a></p>
<p>{{ post.content | strip_html | truncatewords: 26 }} <a class="read-more" href="{{ post.url | relative_url }}">&raquo;</a></p>
</section>
<footer class="post-meta">
{% for author in site.data.authors %}
{% if author[1].username == post.author %}

{% if author[1].assets %}<img class="author-thumb" src="{{ site.baseurl }}{{ author[1].assets }}" alt="Author image" nopin="nopin" />{% endif %}
{% if author[1].assets %}<img class="author-thumb" src="{{ author[1].assets | relative_url }}" alt="Author image" nopin="nopin" />{% endif %}
<!-- author -->
<a href='{{ site.baseurl }}author/{{ post.author }}'>{{ author[1].name }}</a>
<a href='{{ "author/" | append: post.author | relative_url }}'>{{ author[1].name }}</a>

{% endif %}
{% endfor %}
Expand All @@ -38,9 +38,9 @@ <h2 class="post-title"><a href="{{ site.baseurl }}{{ post.url | remove: '/' }}">
on
{% for tag in post.tags %}
{% if forloop.index == post.tags.size %}
<a href='{{ site.baseurl }}tag/{{ tag }}'>{{ tag | capitalize }}</a>
<a href='{{ "tag/" | append: tag | relative_url }}'>{{ tag | capitalize }}</a>
{% else %}
<a href='{{ site.baseurl }}tag/{{ tag }}'>{{ tag | capitalize }}</a>,
<a href='{{ "tag/" | append: tag | relative_url }}'>{{ tag | capitalize }}</a>,
{% endif %}
{% endfor %}
{% endif %}
Expand Down
22 changes: 11 additions & 11 deletions _includes/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ <h3 class="nav-title">Menu</h3>
<span class="hidden">Close</span>
</a>
<ul>
<li class="nav-home {% if page.current == 'home' %} nav-current{% endif %}" role="presentation"><a href="{{ site.baseurl }}">Home</a></li>
<li class="nav-about {% if page.current == 'about' %} nav-current{% endif %}" role="presentation"><a href="{{ site.baseurl }}about">About</a></li>
<li class="nav-fables {% if page.url contains 'fables' %} nav-current{% endif %}" role="presentation"><a href="{{ site.baseurl }}tag/fables">Fables</a></li>
<li class="nav-speeches {% if page.url contains 'speeches' %} nav-current{% endif %}" role="presentation"><a href="{{ site.baseurl }}tag/speeches">Speeches</a></li>
<li class="nav-fiction {% if page.url contains 'fiction' %} nav-current{% endif %}" role="presentation"><a href="{{ site.baseurl }}tag/fiction">Fiction</a></li>
<li class="nav-author {% if page.url contains 'casper' %} nav-current{% endif %}" role="presentation"><a href="{{ site.baseurl }}author/casper">Casper</a></li>
<li class="nav-author {% if page.url contains 'edgar' %} nav-current{% endif %}" role="presentation"><a href="{{ site.baseurl }}author/edgar">Edgar</a></li>
<li class="nav-author {% if page.url contains 'abraham' %} nav-current{% endif %}" role="presentation"><a href="{{ site.baseurl }}author/abraham">Abraham</a></li>
<li class="nav-author {% if page.url contains 'martin' %} nav-current{% endif %}" role="presentation"><a href="{{ site.baseurl }}author/martin">Martin</a></li>
<li class="nav-author {% if page.url contains 'lewis' %} nav-current{% endif %}" role="presentation"><a href="{{ site.baseurl }}author/lewis">Lewis</a></li>
<li class="nav-home {% if page.current == 'home' %} nav-current{% endif %}" role="presentation"><a href="{{ "/" | relative_url }}">Home</a></li>
<li class="nav-about {% if page.current == 'about' %} nav-current{% endif %}" role="presentation"><a href="{{ "about" | relative_url }}">About</a></li>
<li class="nav-fables {% if page.url contains 'fables' %} nav-current{% endif %}" role="presentation"><a href="{{ "tag/fables" | relative_url }}">Fables</a></li>
<li class="nav-speeches {% if page.url contains 'speeches' %} nav-current{% endif %}" role="presentation"><a href="{{ "tag/speeches" | relative_url }}">Speeches</a></li>
<li class="nav-fiction {% if page.url contains 'fiction' %} nav-current{% endif %}" role="presentation"><a href="{{ "tag/fiction" | relative_url }}">Fiction</a></li>
<li class="nav-author {% if page.url contains 'casper' %} nav-current{% endif %}" role="presentation"><a href="{{ "author/casper" | relative_url }}">Casper</a></li>
<li class="nav-author {% if page.url contains 'edgar' %} nav-current{% endif %}" role="presentation"><a href="{{ "author/edgar" | relative_url }}">Edgar</a></li>
<li class="nav-author {% if page.url contains 'abraham' %} nav-current{% endif %}" role="presentation"><a href="{{ "author/abraham" | relative_url }}">Abraham</a></li>
<li class="nav-author {% if page.url contains 'martin' %} nav-current{% endif %}" role="presentation"><a href="{{ "author/martin" | relative_url }}">Martin</a></li>
<li class="nav-author {% if page.url contains 'lewis' %} nav-current{% endif %}" role="presentation"><a href="{{ "author/lewis" | relative_url }}">Lewis</a></li>
</ul>
<a class="subscribe-button icon-feed" href="{{ site.baseurl }}feed.xml">Subscribe</a>
<a class="subscribe-button icon-feed" href="{{ "feed.xml" | relative_url }}">Subscribe</a>
</div>
<span class="nav-cover"></span>
8 changes: 4 additions & 4 deletions _includes/post_pagination.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<nav class="pagination" role="pagination">
{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
<a class="newer-posts" href="{{ site.baseurl }}" title="Previous Page">&laquo; Newer Posts</a>
<a class="newer-posts" href="{{ "/" | relative_url }}" title="Previous Page">&laquo; Newer Posts</a>
{% else %}
<a class="newer-posts" href="{{ site.baseurl }}page{{ paginator.previous_page }}/" title="Previous Page">&laquo; Newer Posts</a>
<a class="newer-posts" href="{{ "page" | append: paginator.previous_page | relative_url }}" title="Previous Page">&laquo; Newer Posts</a>
{% endif %}
{% endif %}
<span class="page-number"> Page {{ paginator.page }} of {{ paginator.total_pages }} </span>
{% if paginator.next_page %}
<a class="older-posts" href="{{ site.baseurl }}page{{ paginator.next_page }}/" title="Next Page">Older Posts &raquo;</a>
<a class="older-posts" href="{{ "page" | append: paginator.next_page | relative_url }}" title="Next Page">Older Posts &raquo;</a>
{% endif %}
</nav>
</nav>
8 changes: 4 additions & 4 deletions _includes/tag_pagination.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<nav class="pagination" role="pagination">
{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
<a class="newer-posts" href="{{ site.baseurl }}tag/{{ page.tag }}" title="Previous Page">&laquo; Newer Posts</a>
<a class="newer-posts" href="{{ "tag/" | append: page.tag | relative_url }}" title="Previous Page">&laquo; Newer Posts</a>
{% else %}
<a class="newer-posts" href="{{ site.baseurl }}tag/{{ page.tag }}/page{{ paginator.previous_page }}/" title="Previous Page">&laquo; Newer Posts</a>
<a class="newer-posts" href="{{ "tag/" | append: page.tag | append: "/page" | append: paginator.previous_page | relative_url }}" title="Previous Page">&laquo; Newer Posts</a>
{% endif %}
{% endif %}
<span class="page-number"> Page {{ paginator.page }} of {{ paginator.total_pages }} </span>
{% if paginator.next_page %}
<a class="older-posts" href="{{ site.baseurl }}tag/{{ page.tag }}/page{{ paginator.next_page }}/" title="Next Page">Older Posts &raquo;</a>
<a class="older-posts" href="{{ "tag/" | append: page.tag | append: "/page" | append: paginator.next_page | relative_url }}" title="Next Page">Older Posts &raquo;</a>
{% endif %}
</nav>
</nav>
6 changes: 3 additions & 3 deletions _layouts/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

<!-- Everything inside the #author tags pulls data from the author -->
<!-- #author -->
<header class="main-header author-head {% if page.cover %}" style="background-image: url({{ site.baseurl }}{{ page.cover }}) {% else %}no-cover{% endif %}">
<header class="main-header author-head {% if page.cover %}" style="background-image: url({{ page.cover | relative_url }}) {% else %}no-cover{% endif %}">
<nav class="main-nav overlay clearfix">
{% if page.logo %}<a class="blog-logo" href="{{ site.baseurl }}"><img src="{{ site.baseurl }}{{ page.logo }}" alt="Blog Logo" /></a>{% endif %}
{% if page.logo %}<a class="blog-logo" href="{{ "/" | relative_url }}"><img src="{{ page.logo | relative_url }}" alt="Blog Logo" /></a>{% endif %}
{% if page.navigation %}
<a class="menu-button icon-menu" href="#"><span class="word">Menu</span></a>
{% endif %}
Expand All @@ -29,7 +29,7 @@
{% if author[1].username == page.author %}
{% if author[1].assets %}
<figure class="author-image">
<div class="img" style="background-image: url({{ site.baseurl }}{{ author[1].assets }})"><span class="hidden">{{ author[1].name }}'s Picture</span></div>
<div class="img" style="background-image: url({{ author[1].assets | relative_url }})"><span class="hidden">{{ author[1].name }}'s Picture</span></div>
</figure>
{% endif %}
<h1 class="author-title">{{ author[1].name }}</h1>
Expand Down
4 changes: 2 additions & 2 deletions _layouts/author.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ title: nil
{% for post in page.posts %}
<item>
<title>{{ post.title }}</title>
<link>{{ site.baseurl }}{{ post.url }}</link>
<link>{{ post.url | relative_url }}</link>
<author>{{ site.author }}</author>
<pubDate>{{ post.date | date_to_xmlschema }}</pubDate>
<guid>{{ site.baseurl }}{{ post.url }}</guid>
<guid>{{ post.url | relative_url }}</guid>
<description><![CDATA[
{{ post.content | expand_urls : site.url }}
]]></description>
Expand Down
12 changes: 6 additions & 6 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<!-- Brand icon -->
<link rel="shortcut icon" href="{{ site.baseurl }}assets/images/favicon.ico" >
<link rel="shortcut icon" href="{{ "assets/images/favicon.ico" | relative_url }}" >

<!-- Styles'n'Scripts -->
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}assets/css/screen.css" />
<link rel="stylesheet" type="text/css" href="{{ "assets/css/screen.css" | relative_url }}" />
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic|Open+Sans:700,400" />
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}assets/css/syntax.css" />
<link rel="stylesheet" type="text/css" href="{{ "assets/css/syntax.css" | relative_url }}" />

<!-- highlight.js -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/default.min.css">
Expand All @@ -41,7 +41,7 @@

<!-- The tiny footer at the very bottom -->
<footer class="site-footer clearfix">
<section class="copyright"><a href="{{ site.baseurl }}">{{ site.name }}</a> &copy; {{ site.time | date: '%Y' }}</section>
<section class="copyright"><a href="{{ "/" | relative_url }}">{{ site.name }}</a> &copy; {{ site.time | date: '%Y' }}</section>
<section class="poweredby">Proudly published with <a href="https://jekyllrb.com/">Jekyll</a> using <a href="https://github.com/jekyllt/jasper">Jasper</a></section>
</footer>
</div>
Expand All @@ -56,9 +56,9 @@
<!-- Add Google Analytics -->
{% include analytics.html %}
<!-- Fitvids makes video embeds responsive and awesome -->
<script type="text/javascript" src="{{ site.baseurl }}assets/js/jquery.fitvids.js"></script>
<script type="text/javascript" src="{{ "assets/js/jquery.fitvids.js" | relative_url }}"></script>
<!-- The main JavaScript file for Casper -->
<script type="text/javascript" src="{{ site.baseurl }}assets/js/index.js"></script>
<script type="text/javascript" src="{{ "assets/js/index.js" | relative_url }}"></script>

</body>
</html>
4 changes: 2 additions & 2 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<!-- Everything inside the #post tags pulls data from the page -->
<!-- #post -->

<header class="main-header post-head {% if page.cover %}" style="background-image: url({{ site.baseurl }}{{ page.cover }}){% else %}no-cover{% endif %}">
<header class="main-header post-head {% if page.cover %}" style="background-image: url({{ page.cover | relative_url }}){% else %}no-cover{% endif %}">
<nav class="main-nav {% if page.cover %}overlay{% endif %} clearfix">
{% if page.logo %}<a class="blog-logo" href="{{ site.baseurl }}"><img src="{{ site.baseurl }}{{ page.logo }}" alt="Blog Logo" /></a>{% endif %}
{% if page.logo %}<a class="blog-logo" href="{{ "/" | relative_url }}"><img src="{{ page.logo | relative_url }}" alt="Blog Logo" /></a>{% endif %}
{% if page.navigation %}
<a class="menu-button icon-menu" href="#"><span class="word">Menu</span></a>
{% endif %}
Expand Down
Loading