Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ac8ac5

Browse files
johndmulhausenjohndmulhausen
authored andcommitted
Relative links JS fix
1 parent 4185aa4 commit 6ac8ac5

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

_layouts/docs.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,14 @@
194194
<section class="section" id="DocumentationText">
195195
{{ content }}
196196
</section>
197+
<script language="javascript">
198+
var x = document.links.length;
199+
for (i = 0; i < x; i++) {
200+
var thisHREF = document.links[i].href;
201+
if (thisHREF.indexOf(window.location.hostname) > -1) thisHREF = thisHREF.replace(".md","/").replace("/index/","/");
202+
document.links[i].setAttribute('href', thisHREF);
203+
}
204+
</script>
197205
</div>
198206
</div>
199207
</div>

compose/completion.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,14 @@ Enjoy working with Compose faster and with less typos!
6666
- [Get started with WordPress](wordpress.md)
6767
- [Command line reference](./reference/index.md)
6868
- [Compose file reference](compose-file.md)
69+
70+
<script language="javascript">
71+
console.log("Domain: " + window.location.hostname);
72+
var x = document.links.length;
73+
for (i = 0; i < x; i++) {
74+
console.log(document.links[i].href);
75+
var thisHREF = document.links[i].href;
76+
thisHREF = thisHREF.replace(".md","/").replace("/index/","/");
77+
document.links[i].setAttribute('href', thisHREF);
78+
}
79+
</script>

docker-cloud/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ menu:
77
parent: docker-cloud
88
weight: -100
99
title: Docker Cloud Overview
10+
permalink: /docker-cloud/overview.md
1011
---
1112

1213
# What is Docker Cloud?

0 commit comments

Comments
 (0)