Use page.root for relative links
This commit is contained in:
parent
ad91ddbe37
commit
aa9c2d2b00
15
_config.yml
15
_config.yml
|
@ -15,6 +15,21 @@ defaults:
|
|||
path: ""
|
||||
values:
|
||||
layout: sidebar
|
||||
-
|
||||
scope:
|
||||
path: "*"
|
||||
values:
|
||||
root: "."
|
||||
-
|
||||
scope:
|
||||
path: "*/*"
|
||||
values:
|
||||
root: ".."
|
||||
-
|
||||
scope:
|
||||
path: "*/*/*"
|
||||
values:
|
||||
root: "../.."
|
||||
|
||||
collections_dir: docs
|
||||
collections:
|
||||
|
|
|
@ -5,28 +5,28 @@
|
|||
|
||||
<title>{% if page.title %}{{ page.title }} | {% endif %}Go Ethereum</title>
|
||||
|
||||
<link rel="icon" type="image/png" href="{{ site.favicon | prepend: site.baseurl | replace: '//', '/'}}" />
|
||||
<link rel="icon" type="image/png" href="{% include link.html url=site.favicon %}" />
|
||||
{% if layout.common-css %}
|
||||
{% for css in layout.common-css %}
|
||||
<link rel="stylesheet" href="{{ css | prepend: site.baseurl | replace: '//', '/' }}" />
|
||||
<link rel="stylesheet" href="{% include link.html url=css %}"" />
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.css %}
|
||||
{% for css in page.css %}
|
||||
<link rel="stylesheet" href="{{ css | prepend: site.baseurl | replace: '//', '/' }}" />
|
||||
<link rel="stylesheet" href="{% include link.html url=css %}"" />
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if layout.common-js %}
|
||||
{% for js in layout.common-js %}
|
||||
<script src="{{ js | prepend: site.baseurl | replace: '//', '/' }}"></script>
|
||||
<script src="{% include link.html url=js %}"></script>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.js %}
|
||||
{% for js in page.js %}
|
||||
<script src="{{ js | prepend: site.baseurl | replace: '//', '/' }}"></script>
|
||||
<script src="{% include link.html url=js %}"></script>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
{{ include.url | remove: ".html" | prepend: site.baseurl | replace: '//', '/' }}
|
||||
{{ include.url | remove: ".html" | prepend: page.root | replace: '//', '/' }}
|
|
@ -17,7 +17,6 @@ common-js:
|
|||
{% include head.html %}
|
||||
|
||||
<body>
|
||||
<p>baseurl: {{ site.baseurl }} </p>
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
|
@ -27,19 +26,20 @@ common-js:
|
|||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{ site.url }}{{ site.baseurl }}">Go Ethereum</a>
|
||||
<a class="navbar-brand" href="{{ page.root }}/">Go Ethereum</a>
|
||||
</div>
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
{% for link in site.data.navbar %}
|
||||
<li>
|
||||
<a href="{{ link[1] | prepend: site.baseurl | replace: '//', '/' }}">{{ link[0] }}</a>
|
||||
<a href="{% include link.html url=link.last %}">{{ link.first }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<p>debug path:{{ page.path }}</p>
|
||||
{{ content }}
|
||||
<hr/>
|
||||
<footer class="container">
|
||||
|
|
Loading…
Reference in New Issue