mirror of https://github.com/docker/docs.git
Add forwarding for page aliases
This commit is contained in:
parent
2cd9cbdfe6
commit
9fd1c9ad27
24
404.md
24
404.md
|
@ -11,6 +11,30 @@ function doFwd() {
|
|||
var portNumber = window.location.port;
|
||||
var gonnaFwd = false;
|
||||
var newURL = "";
|
||||
console.log(forwardingURL);
|
||||
{% for page in site.pages %}{% if page.aliases %}
|
||||
var aliases = {{ page.aliases | jsonify }};
|
||||
if( Object.prototype.toString.call( aliases ) === '[object Array]' ) {
|
||||
// aliases is an array, therefore, there are multiple aliases
|
||||
for (i=0; i< aliases.length; i++)
|
||||
{
|
||||
if (forwardingURL.indexOf(aliases[i]) > -1)
|
||||
{
|
||||
console.log("Found! ", forwardingURL.indexOf(aliases[i]), aliases[i])
|
||||
gonnaFwd = true;
|
||||
newURL = "{{ page.url }}";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// only one alias for this page.
|
||||
if (forwardingURL.indexOf(aliases) > -1)
|
||||
{
|
||||
console.log("Found! ", forwardingURL.indexOf(aliases[i]), aliases[i])
|
||||
gonnaFwd = true;
|
||||
newURL = "{{ page.url }}";
|
||||
}
|
||||
}
|
||||
{% endif %}{% endfor %}
|
||||
{% for item in site.data.docsarchive.docker-compose %}
|
||||
if (forwardingURL.indexOf("/{{ item[0] }}") > -1)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue