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

Change the absolute path to {{ site.baseurl }} to make hyperlinks and resources valid when published as a project page. #37

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion 404.html
Expand Up @@ -5,5 +5,5 @@

<div class="page">
<h1 class="page-title">404: Page not found</h1>
<p class="lead">Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="/">Head back home</a> to try finding it again.</p>
<p class="lead">Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="{{ site.baseurl }}">Head back home</a> to try finding it again.</p>
</div>
12 changes: 6 additions & 6 deletions _includes/head.html
Expand Up @@ -14,15 +14,15 @@
</title>

<!-- CSS -->
<link rel="stylesheet" href="/public/css/poole.css">
<link rel="stylesheet" href="/public/css/syntax.css">
<link rel="stylesheet" href="/public/css/lanyon.css">
<link rel="stylesheet" href="{{ site.baseurl }}public/css/poole.css">
<link rel="stylesheet" href="{{ site.baseurl }}public/css/syntax.css">
<link rel="stylesheet" href="{{ site.baseurl }}public/css/lanyon.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700|PT+Sans:400">

<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/public/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="/public/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ site.baseurl }}public/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="{{ site.baseurl }}public/favicon.ico">

<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ site.baseurl }}atom.xml">
</head>
4 changes: 2 additions & 2 deletions _includes/sidebar.html
Expand Up @@ -9,7 +9,7 @@
</div>

<nav class="sidebar-nav">
<a class="sidebar-nav-item{% if page.title == "Home" %} active{% endif %}" href="/">Home</a>
<a class="sidebar-nav-item{% if page.title == "Home" %} active{% endif %}" href="{{ site.baseurl }}">Home</a>

{% comment %}
The code below dynamically generates a sidebar nav of pages with
Expand All @@ -20,7 +20,7 @@
{% for node in pages_list %}
{% if node.title != null %}
{% if node.layout == "page" %}
<a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{ node.url }}">{{ node.title }}</a>
<a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{ site.baseurl }}.{{ node.url }}">{{ node.title }}</a>
{% endif %}
{% endif %}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Expand Up @@ -13,7 +13,7 @@
<div class="masthead">
<div class="container">
<h3 class="masthead-title">
<a href="/" title="Home">{{ site.title }}</a>
<a href="{{ site.baseurl }}" title="Home">{{ site.title }}</a>
<small>{{ site.tagline }}</small>
</h3>
</div>
Expand Down
2 changes: 1 addition & 1 deletion _layouts/post.html
Expand Up @@ -14,7 +14,7 @@ <h2>Related Posts</h2>
{% for post in site.related_posts limit:3 %}
<li>
<h3>
<a href="{{ post.url }}">
<a href="{{ site.baseurl }}.{{ post.url }}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the dot here between these.

{{ post.title }}
<small>{{ post.date | date_to_string }}</small>
</a>
Expand Down
6 changes: 3 additions & 3 deletions atom.xml
Expand Up @@ -6,8 +6,8 @@ layout: nil
<feed xmlns="http://www.w3.org/2005/Atom">

<title>{{ site.title }}</title>
<link href="{{ site.url }}/atom.xml" rel="self"/>
<link href="{{ site.url }}/"/>
<link href="{{ site.baseurl }}atom.xml" rel="self"/>
<link href="{{ site.baseurl }}"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url }}</id>
<author>
Expand All @@ -18,7 +18,7 @@ layout: nil
{% for post in site.posts %}
<entry>
<title>{{ post.title }}</title>
<link href="{{ site.url }}{{ post.url }}"/>
<link href="{{ site.baseurl }}.{{ post.url }}"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misplaced period

<updated>{{ post.date | date_to_xmlschema }}</updated>
<id>{{ site.url }}{{ post.id }}</id>
<content type="html">{{ post.content | xml_escape }}</content>
Expand Down
8 changes: 4 additions & 4 deletions index.html
Expand Up @@ -7,7 +7,7 @@
{% for post in paginator.posts %}
<div class="post">
<h1 class="post-title">
<a href="{{ post.url }}">
<a href="{{ site.baseurl }}.{{ post.url }}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misplaced period

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emm... Yes, I tested this line without period. It works fine, but the address would appear two '/' in the address line, like http://codinfox.github.io/lanyon//2014/02/01/example-content2/. I added this period for consideration of this. But it seems that with or without this period doesn't matter..

{{ post.title }}
</a>
</h1>
Expand All @@ -21,15 +21,15 @@ <h1 class="post-title">

<div class="pagination">
{% if paginator.next_page %}
<a class="pagination-item older" href="/page{{paginator.next_page}}">Older</a>
<a class="pagination-item older" href="{{ site.baseurl }}page{{paginator.next_page}}">Older</a>
{% else %}
<span class="pagination-item older">Older</span>
{% endif %}
{% if paginator.previous_page %}
{% if paginator.page == 2 %}
<a class="pagination-item newer" href="/">Newer</a>
<a class="pagination-item newer" href="{{ site.baseurl }}">Newer</a>
{% else %}
<a class="pagination-item newer" href="/page{{paginator.previous_page}}">Newer</a>
<a class="pagination-item newer" href="{{ site.baseurl }}page{{paginator.previous_page}}">Newer</a>
{% endif %}
{% else %}
<span class="pagination-item newer">Newer</span>
Expand Down