Skip to content

Commit

Permalink
Add quicklink
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster committed Nov 26, 2023
1 parent 16edb5d commit 410e41d
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 2 deletions.
4 changes: 4 additions & 0 deletions assets/js/quicklink.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
window.addEventListener("load", () => {
quicklink.listen();
});

1 change: 1 addition & 0 deletions assets/lib/quicklink/quicklink.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ autoSwitchAppearance = true
enableSearch = true
enableCodeCopy = true
enableImageLazyLoading = true
enableQuicklink = true

# robots = ""
fingerprintAlgorithm = "sha256"
Expand Down
5 changes: 5 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
{{ $jsSearch := resources.Get "js/search.js" }}
{{ $assets.Add "js" (slice $jsFuse $jsSearch) }}
{{ end }}
{{ if .Site.Params.enableQuicklink | default false }}
{{ $jsQuicklink := resources.Get "lib/quicklink/quicklink.umd.js" }}
{{ $jsQuicklinkInit := resources.Get "js/quicklink.js" }}
{{ $assets.Add "js" (slice $jsQuicklink $jsQuicklinkInit) }}
{{ end }}
{{ if .Site.Params.enableCodeCopy | default false }}
{{ $jsCode := resources.Get "js/code.js" }}
{{ $assets.Add "js" (slice $jsCode) }}
Expand Down
233 changes: 231 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 410e41d

Please sign in to comment.