File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 9
9
< span > ·</ span >
10
10
< span > Theme < a href ="https://git.io/hugopapermod " rel ="noopener " target ="_blank "> PaperMod</ a > </ span >
11
11
</ footer >
12
+ {{- if (not .Site.Params.disableScrollToTop) }}
12
13
< a href ="#top " aria-label ="go to top " title ="Go to Top (Alt + G) ">
13
14
< button class ="top-link " id ="top-link " type ="button " accesskey ="g ">
14
15
< svg xmlns ="http://www.w3.org/2000/svg " viewBox ="0 0 12 6 " fill ="currentColor ">
15
16
< path d ="M12 6H0l6-6z " />
16
17
</ svg >
17
18
</ button >
18
19
</ a >
20
+ {{- end }}
19
21
{{- partial "extend_footer.html" . -}}
20
22
{{- $isHLJSdisabled := (.Site.Params.assets.disableHLJS | default .Params.disableHLJS ) }}
21
23
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}
34
36
document . getElementById ( 'menu' ) . scrollLeft = localStorage . getItem ( "menu-scroll-position" ) ;
35
37
}
36
38
}
39
+
40
+ function menu_on_scroll ( ) {
41
+ localStorage . setItem ( "menu-scroll-position" , document . getElementById ( 'menu' ) . scrollLeft ) ;
42
+ }
43
+
37
44
document . querySelectorAll ( 'a[href^="#"]' ) . forEach ( anchor => {
38
45
anchor . addEventListener ( "click" , function ( e ) {
39
46
e . preventDefault ( ) ;
52
59
}
53
60
} ) ;
54
61
} ) ;
62
+
63
+ </ script >
64
+
65
+ {{- if (not .Site.Params.disableScrollToTop) }}
66
+ < script >
55
67
var mybutton = document . getElementById ( "top-link" ) ;
56
68
window . onscroll = function ( ) {
57
69
if ( document . body . scrollTop > 800 || document . documentElement . scrollTop > 800 ) {
63
75
}
64
76
} ;
65
77
66
- function menu_on_scroll ( ) {
67
- localStorage . setItem ( "menu-scroll-position" , document . getElementById ( 'menu' ) . scrollLeft ) ;
68
- }
69
-
70
78
</ script >
79
+ {{- end }}
80
+
71
81
{{- if (not .Site.Params.disableThemeToggle) }}
72
82
< script >
73
83
document . getElementById ( "theme-toggle" ) . addEventListener ( "click" , ( ) => {
You can’t perform that action at this time.
0 commit comments