Skip to content

Commit

Permalink
Add quicklink
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster committed Oct 23, 2023
1 parent c22dbc0 commit 0a140f3
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 @@ -42,6 +42,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 0a140f3

Please sign in to comment.