mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
doc/_static: match with branch encoded in pathname in URL
since we've migrated to RTD, a typical URL of ceph document looks like https://docs.ceph.com/en/octopus/rados/ so instead of match "/docs.ceph.com/docs/<branch-name>/", we should better match "/en/<branch-name>". in this change, * do not include the domain name in the pattern to be matched, it's not necessary. * match with "/en/<branch-name>/" Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
e5c949dbe9
commit
0980cde334
4
doc/_static/js/ceph.js
vendored
4
doc/_static/js/ceph.js
vendored
@ -20,8 +20,8 @@ $(function() {
|
||||
}
|
||||
|
||||
function get_branch() {
|
||||
var url = window.location.href;
|
||||
var res = url.match(/docs.ceph.com\/docs\/([a-z]+)\/?/i)
|
||||
var pathname = window.location.pathname;
|
||||
var res = pathname.match(/en\/([a-z]+)\/?/i)
|
||||
if (res) {
|
||||
return res[1]
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user