Open jasikpark opened 4 years ago
ack apparently Hugo doesn't support CGO (c ffi) go modules so I'll probably just include the npm module and use https://gohugo.io/hugo-pipes/ -- I'm already using a template for tailwind+postcss in a couple of my sites, so I guess I'll finally learn how they work!
Hugo pipes seem pretty powerful, TIL! And feel free to lmk if you run into any issues - it's my first small wasm lib so I'd be curious to debug anything that comes up.
Btw, why not just make it a rust binary and support N platforms? Does wasm have nice features instead?
My use case needed a wasm module so it could be required by a Node.js plugin I wrote for creating open graph images with custom TTF fonts and no native dependencies.
To create a rust binary I think I'd just need to remove wasm-bindgen/serde...
Hey, thanks @jasikpark ! I'm not up to speed on the latest state of Go/Wasm interoperability, but it would be super cool if there was a way to do it.
I'm not sure if you've used go-ext-wasm, but I'm wondering if it would be suitable for calling the wasm module in a Hugo build step. The binary is published as
wasm_twitter_card_bg.wasm
inwasm-twitter-card
on npm - don't know if there's a way to distribute wasm binaries for Go consumption specifically but you could use the unpkg CDN to download it directly: https://unpkg.com/wasm-twitter-card@0.3.0/wasm_twitter_card_bg.wasm, no JS required :)