Skip to content

Commit

Permalink
use relative_url
Browse files Browse the repository at this point in the history
  • Loading branch information
aksakalli committed Oct 29, 2019
1 parent b5404e9 commit 8e59410
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion _includes/docs_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h4 class="panel-title">
{% for item in section.docs %}
{% assign item_url = item | prepend:"/docs/" | append:"/" %}
{% assign p = site.docs | where:"url", item_url | first %}
<a class="list-group-item {% if item_url == page.url %}active{% endif %}" href="{{ p.url | prepend: site.baseurl }}">{{ p.title }}</a>
<a class="list-group-item {% if item_url == page.url %}active{% endif %}" href="{{ p.url | relative_url }}">{{ p.title }}</a>
{% endfor %}
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
<link rel="stylesheet" href="{{ "/css/font-awesome.min.css" | prepend: site.baseurl }}">
<link rel="stylesheet" href="{{ "/css/main.css" | relative_url }}">
<link rel="stylesheet" href="{{ "/css/font-awesome.min.css" | relative_url }}">

<link rel="shortcut icon" href="{{ "/favicon.ico?1" | prepend: site.baseurl }}">
<link rel="shortcut icon" href="{{ "/favicon.ico?1" | relative_url }}">
{% seo %}

<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | absolute_url }}" />
</head>
6 changes: 3 additions & 3 deletions _includes/js_files.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var baseurl = '{{ site.baseurl }}'
</script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="{{ "/js/bootstrap.min.js" | prepend: site.baseurl }} "></script>
<script src="{{ "/js/typeahead.bundle.min.js" | prepend: site.baseurl }} "></script>
<script src="{{ "/js/bootstrap.min.js" | relative_url }} "></script>
<script src="{{ "/js/typeahead.bundle.min.js" | relative_url }} "></script>

<script src="{{ "/js/main.js" | prepend: site.baseurl }} "></script>
<script src="{{ "/js/main.js" | relative_url }} "></script>
4 changes: 2 additions & 2 deletions _includes/section_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{% assign previous = forloop.index0 | minus: 1 %}
{% assign previous_page = docs[previous] | prepend:"/docs/" | append:"/" %}
<li class="previous">
<a href="{{ previous_page | prepend: site.baseurl }}">
<a href="{{ previous_page | relative_url }}">
<span aria-hidden="true">&larr;</span> Previous
</a>
</li>
Expand All @@ -40,7 +40,7 @@
{% assign next = forloop.index0 | plus: 1 %}
{% assign next_page = docs[next] | prepend:"/docs/" | append:"/" %}
<li class="next">
<a href="{{ next_page | prepend: site.baseurl }}">
<a href="{{ next_page | relative_url }}">
Next <span aria-hidden="true">&rarr;</span>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions _includes/topnav.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li {% if page.sectionid=='docs' %} class="active" {% endif %}><a href="{{ "/docs/home/" | prepend: site.baseurl }}">Docs</a></li>
<li {% if page.sectionid=='blog' %} class="active" {% endif %}><a href="{{ site.posts.first.url | prepend: site.baseurl }}">Blog</a></li>
<li {% if page.sectionid=='docs' %} class="active" {% endif %}><a href="{{ "/docs/home/" | relative_url }}">Docs</a></li>
<li {% if page.sectionid=='blog' %} class="active" {% endif %}><a href="{{ site.posts.first.url | relative_url }}">Blog</a></li>
</ul>
<div class="navbar-right">
<form class="navbar-form navbar-left">
Expand Down
8 changes: 4 additions & 4 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<h4>RECENT POSTS</h4>
<ul class="list-unstyled post-list-container">
{% for post in site.posts limit:10 %}
<li><a href="{{ post.url | prepend: site.baseurl }}" {% if page.title==post.title %} class="active" {% endif %}>{{ post.title }}</a></li>
<li><a href="{{ post.url | relative_url }}" {% if page.title==post.title %} class="active" {% endif %}>{{ post.title }}</a></li>
{% endfor %}
<li><a href="{{ "/allposts" | prepend: site.baseurl }}">All posts ...</a></li>
<li><a href="{{ "/allposts" | relative_url }}">All posts ...</a></li>
</ul>
</div>
</div>
Expand All @@ -25,13 +25,13 @@ <h1>{{ page.title }}</h1>
<ul class="pager">
{% if page.previous %}
<li class="previous">
<a href="{{ page.previous.url | prepend: site.baseurl }}">
<a href="{{ page.previous.url | relative_url }}">
<span aria-hidden="true">&larr;</span> Older
</a>
</li>
{% endif %} {% if page.next %}
<li class="next">
<a href="{{ page.next.url | prepend: site.baseurl }}">
<a href="{{ page.next.url | relative_url }}">
Newer <span aria-hidden="true">&rarr;</span>
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion allposts.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="inner-content">
<h1>All Posts</h1> {% for page in site.posts %}
<p>
<strong><a href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a></strong>
<strong><a href="{{ page.url | relative_url }}">{{ page.title }}</a></strong>
<span>on {{ page.date | date: "%B %e, %Y" }} {% if page.author %} by {{ page.author }}{% endif %}</span>
</p>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h1>Jekyll Template for Project Websites</h1>
<p>Simple and modern design for publishing blog posts, documentation and many more things about your project.
You can now clone and start to create a website for your project like this one.</p>
<p><a class="btn btn-primary btn-lg" href="{{ "/docs/home/" | prepend: site.baseurl }}" role="button">Learn more</a></p>
<p><a class="btn btn-primary btn-lg" href="{{ "/docs/home/" | relative_url }}" role="button">Learn more</a></p>
</div>
</div>

Expand Down
5 changes: 2 additions & 3 deletions search.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
{% assign p = site.docs | where:"url", item_url | first %}
{
"title": "{{ p.title }}",
"url": "{{ p.url | prepend: site.baseurl }}"

"url": "{{ p.url | relative_url }}"
},
{% endfor %}
{% endfor %}

{% for post in site.posts %}
{
"title": "{{ post.title | escape }}",
"url": "{{ post.url | prepend: site.baseurl }}"
"url": "{{ post.url | relative_url }}"
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]

0 comments on commit 8e59410

Please sign in to comment.