Skip to content

Commit 6a3d478

Browse files
committed
fixing baseurl related issues
1 parent ce6c209 commit 6a3d478

File tree

8 files changed

+16
-19
lines changed

8 files changed

+16
-19
lines changed

_config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ email: [email protected]
44
description: > # Jekyll Template for Project Websites
55
providing documentation and blog post pages.
66
7-
baseurl: "jekyll-doc-theme" # the subpath of your site, e.g. /blog/
7+
baseurl: "/jekyll-doc-theme" # the subpath of your site, e.g. /blog/
88
url: http://aksakalli.github.io/jekyll-doc-theme # the base hostname & protocol for your site
99
git_address: https://github.com/aksakalli/jekyll-doc-theme
10-
git_edit_address: https://github.com/aksakalli/jekyll-doc-theme/master
10+
git_edit_address: https://github.com/aksakalli/jekyll-doc-theme/blob/gh-pages
1111

1212
# Build settings
1313
markdown: kramdown

_docs/index.md

-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,3 @@ Add a new Markdown file such as `2017-05-09-my-post.md` and write the content si
4848
The home page is located under `index.html` file. You can change the content or design completely different welcome page for your taste. (You can use [bootstrap componenets](http://getbootstrap.com/components/))
4949

5050
In order to add a new page, create a new html or markdown file under root directory and link it in `_includes/topnav.html`.
51-
52-
```
53-
54-
```

_includes/docs_nav.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h4 class="panel-title">
1313
{% for item in section.docs %}
1414
{% assign item_url = item | prepend:"/docs/" | append:"/" %}
1515
{% assign p = site.docs | where:"url", item_url | first %}
16-
<a class="list-group-item {% if item_url == page.url %}active{% endif %}" href="{{ p.url }}">{{ p.title }}</a>
16+
<a class="list-group-item {% if item_url == page.url %}active{% endif %}" href="{{ p.url | prepend: site.baseurl }}">{{ p.title }}</a>
1717
{% endfor %}
1818
</ul>
1919
</div>

_includes/head.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
88

99

10-
<link rel="stylesheet" href="{{ " /css/main.css " | prepend: site.baseurl }}">
11-
<link rel="stylesheet" href="{{ " /css/font-awesome.min.css " | prepend: site.baseurl }}">
10+
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
11+
<link rel="stylesheet" href="{{ "/css/font-awesome.min.css" | prepend: site.baseurl }}">
1212
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500" type="text/css">
1313

1414

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

1818
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
19-
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ " /feed.xml " | prepend: site.baseurl | prepend: site.url }}" />
19+
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
2020
</head>

_includes/js_files.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
<script>
2+
var baseurl = '{{ site.baseurl }}'
3+
</script>
14
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
2-
<script src="{{ " /js/bootstrap.min.js " | prepend: site.baseurl }} "></script>
3-
<script src="{{ " /js/typeahead.bundle.min.js " | prepend: site.baseurl }} "></script>
5+
<script src="{{ "/js/bootstrap.min.js" | prepend: site.baseurl }} "></script>
6+
<script src="{{ "/js/typeahead.bundle.min.js" | prepend: site.baseurl }} "></script>
47

5-
<script src="{{ " /js/main.js " | prepend: site.baseurl }} "></script>
8+
<script src="{{ "/js/main.js" | prepend: site.baseurl }} "></script>

_includes/topnav.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</div>
1414
<div id="navbar" class="collapse navbar-collapse">
1515
<ul class="nav navbar-nav">
16-
<li {% if page.sectionid=='docs' %} class="active" {% endif %}><a href="{{ " /docs/home/ " | prepend: site.baseurl }}">Docs</a></li>
16+
<li {% if page.sectionid=='docs' %} class="active" {% endif %}><a href="{{ "/docs/home/" | prepend: site.baseurl }}">Docs</a></li>
1717
<li {% if page.sectionid=='blog' %} class="active" {% endif %}><a href="{{ site.posts.first.url | prepend: site.baseurl }}">Blog</a></li>
1818
</ul>
1919
<div class="navbar-right">

js/main.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ $(function() {
99
// datumTokenizer: Bloodhound.tokenizers.whitespace,
1010
queryTokenizer: Bloodhound.tokenizers.whitespace,
1111

12-
// local: ['dog', 'pig', 'moose'],
13-
14-
prefetch: '/search.json'
12+
prefetch: baseurl + '/search.json'
1513
});
1614

1715
$('#search-box').typeahead({

search.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% assign p = site.docs | where:"url", item_url | first %}
88
{
99
"title": "{{ p.title }}",
10-
"url": "{{ p.url }}"
10+
"url": "{{ p.url | prepend: site.baseurl }}"
1111

1212
},
1313
{% endfor %}

0 commit comments

Comments
 (0)