fix(site-menu): use anchorized title
fixes https://github.com/janraasch/hugo-scroll/pull/6. This way we put less burden on JavaScript / jQuery, which is always good :-D.
This commit is contained in:
parent
f9332ad4f4
commit
f483bbaea4
2 changed files with 3 additions and 4 deletions
|
|
@ -9,7 +9,7 @@
|
|||
{{ with .Params.header_subheadline }}<h2 class="blog-description">{{ . }}</h2>{{ end }}
|
||||
|
||||
{{ range where $sections ".Params.header_menu" "eq" true }}
|
||||
<a class='btn site-menu' data-title='{{ .Title }}'>{{ .Title }}</a>
|
||||
<a class='btn site-menu' data-title-anchor='{{ anchorize .Title }}'>{{ .Title }}</a>
|
||||
{{ end }}
|
||||
<i id='header-arrow' class="fa fa-angle-down"></i>
|
||||
</div>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
{{ range $index_val, $elem_val := $sections }}
|
||||
<div class='post-holder'>
|
||||
<article class='post {{ if eq $index_val 0 }}first{{ else }}{{ if eq (add $index_val 1) (len $sections) }}last{{ end }}{{ end }}'>
|
||||
<article id='{{ anchorize .Title }}' class='post {{ if eq $index_val 0 }}first{{ else }}{{ if eq (add $index_val 1) (len $sections) }}last{{ end }}{{ end }}'>
|
||||
<header class="post-header">
|
||||
<h2 class="post-title">{{ .Title }}</h2>
|
||||
</header>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue