Skip to content

Commit

Permalink
Add quicklink
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster committed Sep 11, 2023
1 parent 1e90d7f commit 0ec00bc
Show file tree
Hide file tree
Showing 6 changed files with 245 additions and 0 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 @@ -58,6 +58,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
229 changes: 229 additions & 0 deletions package-lock.json

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

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"prettier": "^3.0.3",
"prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-tailwindcss": "^0.5.4",
"quicklink": "^2.3.0",
"rimraf": "^5.0.1",
"tailwindcss": "^3.3.3",
"vendor-copy": "^3.0.1"
Expand Down Expand Up @@ -70,6 +71,10 @@
{
"from": "node_modules/fuse.js/dist/fuse.min.js",
"to": "assets/lib/fuse/fuse.min.js"
},
{
"from": "node_modules/quicklink/dist/quicklink.umd.js",
"to": "assets/lib/quicklink/quicklink.umd.js"
}
]
}

0 comments on commit 0ec00bc

Please sign in to comment.