mirror of
https://github.com/caddyserver/website.git
synced 2025-04-22 04:56:17 -04:00
15 lines
503 B
JavaScript
15 lines
503 B
JavaScript
![]() |
$(function() {
|
||
|
function hasPrefix(str, prefix) {
|
||
|
if (!prefix) return true;
|
||
|
if (!str) return false;
|
||
|
return str.indexOf(prefix) === 0;
|
||
|
}
|
||
|
|
||
|
// highlight current page in left nav
|
||
|
var $currentPageLink = $('main nav a[href="'+window.location.pathname+'"]');
|
||
|
if (hasPrefix(window.location.pathname, "/docs/json/")) {
|
||
|
// as a special case, highlight the JSON structure link anywhere within it
|
||
|
$currentPageLink = $('main nav a[href="/docs/json/"]');
|
||
|
}
|
||
|
$currentPageLink.addClass('current');
|
||
|
});
|