File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 73
73
{% include scripts /jekyll_tabs .liquid %}
74
74
{% include scripts /back_to_top .liquid %}
75
75
{% include scripts /search .liquid %}
76
+ <script src =" {{ '/assets/js/shortcut-key.js' | relative_url }}" ></script >
76
77
</body >
77
78
</html >
Original file line number Diff line number Diff line change
1
+ // Check if the user is on a Mac and update the shortcut key for search accordingly
2
+ document . onreadystatechange = ( ) => {
3
+ if ( document . readyState === "interactive" ) {
4
+ let isMac = navigator . platform . toUpperCase ( ) . indexOf ( "MAC" ) >= 0 ;
5
+ let shortcutKeyElement = document . querySelector ( "#search-toggle .nav-link" ) ;
6
+ if ( shortcutKeyElement && isMac ) {
7
+ // use the unicode for command key
8
+ shortcutKeyElement . innerHTML = '⌘ k <i class="ti ti-search"></i>' ;
9
+ }
10
+ }
11
+ } ;
You can’t perform that action at this time.
0 commit comments