mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 20:46:15 -04:00
add .current to the current link
This commit is contained in:
parent
254e415a61
commit
70d8ddacf1
2 changed files with 13 additions and 2 deletions
|
@ -7,4 +7,16 @@
|
|||
{{end}}
|
||||
<script type="text/javascript">window.CaddyfileDirectives = {{$directives | toJson}};</script>
|
||||
<script src="/resources/js/jquery-3.4.1.min.js"></script>
|
||||
<script src="/resources/js/docs.js"></script>
|
||||
<script src="/resources/js/docs.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var current = location.pathname;
|
||||
$('header > nav a').each(function(){
|
||||
var $this = $(this);
|
||||
// if the current path is like this link, make it active
|
||||
if (current.indexOf($this.attr('href')) !== -1) {
|
||||
$this.addClass('current');
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
<!--TODO: add class="current" to the current link-->
|
||||
<nav>
|
||||
<div id="search"></div>
|
||||
<a href="/v2">v2 <span class="new">new</span></a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue