mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
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
This commit is contained in:
@@ -71,7 +71,7 @@ func (ns *Namespace) Unmarshal(args ...any) (any, error) {
|
||||
key += decoder.OptionsKey()
|
||||
}
|
||||
|
||||
v, err := ns.cache.GetOrCreate(key, func(string) (*resources.StaleValue[any], error) {
|
||||
v, err := ns.cacheUnmarshal.GetOrCreate(key, func(string) (*resources.StaleValue[any], error) {
|
||||
f := metadecoders.FormatFromStrings(r.MediaType().Suffixes()...)
|
||||
if f == "" {
|
||||
return nil, fmt.Errorf("MIME %q not supported", r.MediaType())
|
||||
@@ -119,7 +119,7 @@ func (ns *Namespace) Unmarshal(args ...any) (any, error) {
|
||||
|
||||
key := hashing.MD5FromStringHexEncoded(dataStr)
|
||||
|
||||
v, err := ns.cache.GetOrCreate(key, func(string) (*resources.StaleValue[any], error) {
|
||||
v, err := ns.cacheUnmarshal.GetOrCreate(key, func(string) (*resources.StaleValue[any], error) {
|
||||
f := decoder.FormatFromContentString(dataStr)
|
||||
if f == "" {
|
||||
return nil, errors.New("unknown format")
|
||||
|
Reference in New Issue
Block a user