From 33c0938cd50dd3409f8e94878b97d789cc328f23 Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Wed, 7 Aug 2024 10:40:54 +0200 Subject: Add build time math rendering While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * https://github.com/gohugoio/hugo/issues/12736 * https://github.com/gohugoio/hugo/issues/12737 See #11927 --- deps/deps.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'deps') diff --git a/deps/deps.go b/deps/deps.go index 0d0f283c2..e137aed7b 100644 --- a/deps/deps.go +++ b/deps/deps.go @@ -23,6 +23,7 @@ import ( "github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/hugofs" "github.com/gohugoio/hugo/identity" + "github.com/gohugoio/hugo/internal/warpc" "github.com/gohugoio/hugo/media" "github.com/gohugoio/hugo/resources/page" "github.com/gohugoio/hugo/resources/postpub" @@ -93,6 +94,10 @@ type Deps struct { // This is common/global for all sites. BuildState *BuildState + // Holds RPC dispatchers for Katex etc. + // TODO(bep) rethink this re. a plugin setup, but this will have to do for now. + WasmDispatchers *warpc.Dispatchers + *globalErrHandler } @@ -343,6 +348,9 @@ func (d *Deps) Close() error { if d.MemCache != nil { d.MemCache.Stop() } + if d.WasmDispatchers != nil { + d.WasmDispatchers.Close() + } return d.BuildClosers.Close() } -- cgit v1.2.3