Skip to content

Commit

Permalink
Add quicklink
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster authored and jpanther committed Nov 27, 2023
1 parent fa3a47c commit 1e32419
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 @@ -13,6 +13,7 @@ enableSearch = true
enableCodeCopy = true
enableImageLazyLoading = true
enableImageWebp = 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 1e32419

Please sign in to comment.