diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml
index d4df526e..f3432780 100644
--- a/.github/workflows/commit.yaml
+++ b/.github/workflows/commit.yaml
@@ -2,8 +2,16 @@ name: Test
on:
pull_request:
branches: [main]
+ paths-ignore: # ignore docs as they are built with Netlify.
+ - '**/*.md'
+ - 'site/**'
+ - 'netlify.toml'
push:
branches: [main]
+ paths-ignore: # ignore docs as they are built with Netlify.
+ - '**/*.md'
+ - 'site/**'
+ - 'netlify.toml'
env: # Update this prior to requiring a higher minor version in go.mod
GO_VERSION: "1.17" # 1.xx == latest patch of 1.xx
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..410c91f4
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "site/themes/hello-friend"]
+ path = site/themes/hello-friend
+ url = https://github.com/panr/hugo-theme-hello-friend.git
diff --git a/.netlify/state.json b/.netlify/state.json
new file mode 100644
index 00000000..2310f828
--- /dev/null
+++ b/.netlify/state.json
@@ -0,0 +1,3 @@
+{
+ "siteId": "070b842d-92a6-4bbf-bcc9-7cbfb635355e"
+}
diff --git a/Makefile b/Makefile
index 9b5efc68..129a4e98 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
goimports := golang.org/x/tools/cmd/goimports@v0.1.10
golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.0
+# sync this with netlify.toml!
+hugo := github.com/gohugoio/hugo@v0.98.0
ensureJITFastest := -ldflags '-X github.com/tetratelabs/wazero/internal/integration_test/vs.ensureJITFastest=true'
.PHONY: bench
@@ -88,3 +90,8 @@ check:
echo "The following differences will fail CI until committed:"; \
git diff --exit-code; \
fi
+
+.PHONY: site
+site: ## Serve website content
+ @git submodule update --init
+ @cd site && go run $(hugo) server --minify --disableFastRender --baseURL localhost:1313 --cleanDestinationDir -D
diff --git a/README.md b/README.md
index fe4cf4c7..6e5a1a76 100644
--- a/README.md
+++ b/README.md
@@ -12,8 +12,7 @@ Import wazero and extend your Go application with code written in any language!
## Example
-The best way to learn this and other features you get with wazero is by trying
-one of our [examples](examples).
+The best way to learn wazero is by trying one of our [examples](examples).
For the impatient, here's how invoking a factorial function looks in wazero:
@@ -343,6 +342,9 @@ runtimes because [CGO is slow][27]. More specifically, if you make large amount
of CGO calls which cross the boundary between Go and C (stack) space, then the
usage of CGO could be a bottleneck.
+-----
+wazero is a registered trademark of Tetrate.io, Inc. in the United States and/or other countries
+
[1]: https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/
[2]: https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/
[3]: ./internal/integration_test/post1_0/multi-value/testdata/fac.wat
diff --git a/netlify.toml b/netlify.toml
new file mode 100644
index 00000000..70aa4dca
--- /dev/null
+++ b/netlify.toml
@@ -0,0 +1,15 @@
+[build]
+ base = "site"
+ publish = "public"
+
+[build.environment]
+ HUGO_VERSION = "0.98.0"
+
+[context.production]
+ command = "git submodule update --init && hugo --gc --minify"
+
+[context.deploy-preview]
+ command = "git submodule update --init && hugo --gc --minify -b $DEPLOY_PRIME_URL"
+
+[context.branch-deploy]
+ command = "git submodule update --init && hugo --gc --minify -b $DEPLOY_PRIME_URL"
diff --git a/site/.gitignore b/site/.gitignore
new file mode 100644
index 00000000..b2721f3a
--- /dev/null
+++ b/site/.gitignore
@@ -0,0 +1,4 @@
+resources/
+public/
+.DS_Store
+.hugo_build.lock
diff --git a/site/README.md b/site/README.md
new file mode 100644
index 00000000..8194d204
--- /dev/null
+++ b/site/README.md
@@ -0,0 +1,9 @@
+# wazero.io
+
+This directory holds the wazero site's source code. To visit the site, click [here](https://wazero.io/)
+
+The website is built using [Hugo](https://gohugo.io/), as static website
+generator, and [Hello Friend](https://github.com/panr/hugo-theme-hello-friend) theme.
+
+## Deployment process
+This site deploys via Netlify on change to the `main` branch.
diff --git a/site/config.toml b/site/config.toml
new file mode 100644
index 00000000..53f76b74
--- /dev/null
+++ b/site/config.toml
@@ -0,0 +1,29 @@
+baseURL = "https://wazero.io/"
+languageCode = "en-us"
+defaultContentLanguage = "en"
+title = "wazero"
+theme = "hello-friend"
+
+[params]
+ defaultTheme = "light"
+ showReadingTime = false
+
+[languages]
+ [languages.en]
+ # TODO: dark theme logo https://github.com/panr/hugo-theme-hello-friend/issues/291
+ [languages.en.params.logo]
+ logoText = "wazero"
+ path = "/img/wazero.svg"
+ [languages.en.menu]
+ [[languages.en.menu.main]]
+ url = "https://pkg.go.dev/github.com/tetratelabs/wazero"
+ name = "API"
+ weight = 10
+ [[languages.en.menu.main]]
+ url = "https://github.com/tetratelabs/wazero/blob/main/examples"
+ name = "Examples"
+ weight = 10
+ [[languages.en.menu.main]]
+ url = "https://github.com/tetratelabs/wazero"
+ name = "GitHub"
+ weight = 20
diff --git a/site/content/_index.md b/site/content/_index.md
new file mode 100644
index 00000000..507b5983
--- /dev/null
+++ b/site/content/_index.md
@@ -0,0 +1,74 @@
++++
+title = "wazero: the zero dependency WebAssembly runtime for Go developers"
+layout = "single"
++++
+
+WebAssembly is a way to safely run code compiled in other languages. Runtimes
+execute WebAssembly Modules (Wasm), which are most often binaries with a
+`.wasm` extension.
+
+wazero is the only zero dependency WebAssembly runtime written in Go.
+
+## Example
+
+The best way to learn wazero is by trying one of our [examples][1]
+
+For the impatient, here's how invoking a factorial function looks in wazero:
+
+```go
+func main() {
+ // Choose the context to use for function calls.
+ ctx := context.Background()
+
+ // Read a WebAssembly binary containing an exported "fac" function.
+ // * Ex. (func (export "fac") (param i64) (result i64) ...
+ source, err := os.ReadFile("./path/to/fac.wasm")
+ if err != nil {
+ log.Panicln(err)
+ }
+
+ // Create a new WebAssembly Runtime.
+ r := wazero.NewRuntime()
+ defer r.Close(ctx) // This closes everything this Runtime created.
+
+ // Instantiate the module and return its exported functions
+ module, err := r.InstantiateModuleFromCode(ctx, source)
+ if err != nil {
+ log.Panicln(err)
+ }
+
+ // Discover 7! is 5040
+ fmt.Println(module.ExportedFunction("fac").Call(ctx, 7))
+}
+```
+
+Note: `fac.wasm` was compiled from [fac.wat][2], in the [WebAssembly 1.0][3]
+Text Format, it could have been written in another language that compiles to
+(targets) WebAssembly, such as AssemblyScript, C, C++, Rust, TinyGo or Zig.
+
+## Why zero?
+
+By avoiding CGO, wazero avoids prerequisites such as shared libraries or libc,
+and lets you keep features like cross compilation. Being pure Go, wazero adds
+only a small amount of size to your binary. Meanwhile, wazero’s API gives
+features you expect in Go, such as safe concurrency and context propagation.
+
+### When can I use this?
+
+wazero is an early project, so APIs are subject to change until version 1.0.
+To use wazero meanwhile, you need to add its main branch to your project like
+this:
+
+```bash
+go get github.com/tetratelabs/wazero@main
+```
+
+We expect [wazero 1.0][4] to be at or before Q3 2022, so please practice the
+current APIs to ensure they work for you, and give us a [star][5] if you are
+enjoying it so far!
+
+[1]: https://github.com/tetratelabs/wazero/blob/main/examples
+[2]: https://github.com/tetratelabs/wazero/blob/main/internal/integration_test/post1_0/multi-value/testdata/fac.wat
+[3]: https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/
+[4]: https://github.com/tetratelabs/wazero/issues/506
+[5]: https://github.com/tetratelabs/wazero/stargazers
diff --git a/site/layouts/partials/extended_head.html b/site/layouts/partials/extended_head.html
new file mode 100644
index 00000000..fee65c07
--- /dev/null
+++ b/site/layouts/partials/extended_head.html
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/site/layouts/partials/footer.html b/site/layouts/partials/footer.html
new file mode 100644
index 00000000..191789ee
--- /dev/null
+++ b/site/layouts/partials/footer.html
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/site/static/.DS_Store b/site/static/.DS_Store
new file mode 100644
index 00000000..a8d4bf13
Binary files /dev/null and b/site/static/.DS_Store differ
diff --git a/site/static/favicon.ico b/site/static/favicon.ico
new file mode 100644
index 00000000..7a9a9d2d
Binary files /dev/null and b/site/static/favicon.ico differ
diff --git a/site/static/img/icon@16w.png b/site/static/img/icon@16w.png
new file mode 100644
index 00000000..b7942d6f
Binary files /dev/null and b/site/static/img/icon@16w.png differ
diff --git a/site/static/img/icon@180w.png b/site/static/img/icon@180w.png
new file mode 100644
index 00000000..1a1fafe7
Binary files /dev/null and b/site/static/img/icon@180w.png differ
diff --git a/site/static/img/icon@192w.png b/site/static/img/icon@192w.png
new file mode 100644
index 00000000..5c7df4ac
Binary files /dev/null and b/site/static/img/icon@192w.png differ
diff --git a/site/static/img/icon@32w.png b/site/static/img/icon@32w.png
new file mode 100644
index 00000000..46429b3e
Binary files /dev/null and b/site/static/img/icon@32w.png differ
diff --git a/site/static/img/icon@512w.png b/site/static/img/icon@512w.png
new file mode 100644
index 00000000..7f1c3df6
Binary files /dev/null and b/site/static/img/icon@512w.png differ
diff --git a/site/static/img/wazero.svg b/site/static/img/wazero.svg
new file mode 100644
index 00000000..fef53f1c
--- /dev/null
+++ b/site/static/img/wazero.svg
@@ -0,0 +1,9 @@
+
+
diff --git a/site/static/manifest.webmanifest b/site/static/manifest.webmanifest
new file mode 100644
index 00000000..c4a8b8e0
--- /dev/null
+++ b/site/static/manifest.webmanifest
@@ -0,0 +1,34 @@
+{
+ "name": "wazero",
+ "short_name": "wazero",
+ "description": "wazero: the zero dependency WebAssembly runtime for Go developers",
+ "start_url": "/",
+ "background_color": "white",
+ "icons": [
+ {
+ "src": "img/icon@16w.png",
+ "sizes": "16x16",
+ "type": "image/png"
+ },
+ {
+ "src": "img/icon@32w.png",
+ "sizes": "32x32",
+ "type": "image/png"
+ },
+ {
+ "src": "img/icon@180w.png",
+ "sizes": "180x180",
+ "type": "image/png"
+ },
+ {
+ "src": "img/icon@192w.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "img/icon@512w.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ]
+}
diff --git a/site/themes/hello-friend b/site/themes/hello-friend
new file mode 160000
index 00000000..3ffa8121
--- /dev/null
+++ b/site/themes/hello-friend
@@ -0,0 +1 @@
+Subproject commit 3ffa8121a004a29d6fd5f1133257ab2ebfea22c4