Skip to content

Commit 4f9bafd

Browse files
authored
Remove anchor from URL when switching language (cocos#1530)
* Update page.html * Update page.html
1 parent 24096a2 commit 4f9bafd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

en/_layouts/website/page.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
path = path.replace(/\/en[\/$\s]/i, '/zh/');
4949
}
5050
// console.log('after: ' + path);
51+
// remove point
52+
path = path.split("#")[0];
5153
location.assign(path);
5254
}
5355
</script>
54-
{% endblock %}
56+
{% endblock %}

zh/_layouts/website/page.html

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
path = path.replace(/\/en[\/$\s]/i, '/zh/');
4949
}
5050
// console.log('after: ' + path);
51+
// remove point
52+
path = path.split("#")[0];
5153
location.assign(path);
5254
}
5355
</script>

0 commit comments

Comments
 (0)