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>
}
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]
}