Skip to content

Commit

Permalink
perf(hugopress): cache head-end and body-end hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jun 16, 2024
1 parent 5e26dfa commit 255695b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ module github.com/hugomods/katex

go 1.19

require github.com/KaTeX/KaTeX v0.16.9 // indirect
require (
github.com/KaTeX/KaTeX v0.16.9 // indirect
github.com/hugomods/hugopress v0.5.0 // indirect
)
5 changes: 3 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
github.com/KaTeX/KaTeX v0.16.7 h1:BolOcpj8bjgRW6WcZCHBBwvNhqmyGK1FbcQSiHYTHu0=
github.com/KaTeX/KaTeX v0.16.7/go.mod h1:VI+aE+CVs/VqtbHnuhstfQST46GmrwpXH7LQAzYIouw=
github.com/KaTeX/KaTeX v0.16.9 h1:4VYWM2nMSCfOPi63mTRJYQs0UmZPGTx3noiQ/vJu9Rk=
github.com/KaTeX/KaTeX v0.16.9/go.mod h1:VI+aE+CVs/VqtbHnuhstfQST46GmrwpXH7LQAzYIouw=
github.com/hugomods/hugopress v0.5.0 h1:eQHg1aKnc5StGFnV5H0BORhE0UmHYpaWHnX9QNseHrw=
github.com/hugomods/hugopress v0.5.0/go.mod h1:CRYvr60xOkZOf4Atkuj+uEj2EH5pjJ39Ws3aJAkoMkA=
9 changes: 9 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@
[module.hugoVersion]
min = "0.110.0"

[[module.imports]]
path = "github.com/hugomods/hugopress"

[[module.imports]]
path = "github.com/KaTeX/KaTeX"
[[module.imports.mounts]]
source = "fonts"
target = "assets/mods/katex/fonts"

[params.hugopress.modules.katex.hooks.head-end]
cacheable = true
cache_store_key = "hasKaTeX"
partial = "katex/assets/css"

[params.hugopress.modules.katex.hooks.body-end]
cacheable = true
cache_store_key = "hasKaTeX"
partial = "katex/assets/js"

0 comments on commit 255695b

Please sign in to comment.