From 22b0567d2bc67523a68fb4453c1fdcdc1d9515bc Mon Sep 17 00:00:00 2001 From: Matt Hunzinger Date: Thu, 19 Sep 2024 17:54:29 -0400 Subject: [PATCH 1/2] Add Netlify publish guide --- docs-src/0.5/en/cookbook/publishing.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs-src/0.5/en/cookbook/publishing.md b/docs-src/0.5/en/cookbook/publishing.md index d1cd44002..ad8108eed 100644 --- a/docs-src/0.5/en/cookbook/publishing.md +++ b/docs-src/0.5/en/cookbook/publishing.md @@ -26,6 +26,17 @@ dx build --release - Add and commit with git - Push to GitHub +## Web: Publishing with Netlify +Set your Netlify build command to `cargo install dioxus-cli && dx build —release`. + +If you're using `dioxus-router`, you can configure Netlify to redirect all routes to your own `dioxus_router::Router` by creating the following `Netlify.toml` in your app's root directoy: +```toml +[[redirects]] + from = "/*" + to = "/index.html" + status = 200 +``` + ## Desktop: Creating an installer Dioxus desktop app uses your operating system's WebView library, so it's portable to be distributed for other platforms. From 1ba28cf3680bbbb53b39ec92e4db23ed7147cf8d Mon Sep 17 00:00:00 2001 From: Matt Hunzinger Date: Tue, 24 Sep 2024 15:30:42 -0400 Subject: [PATCH 2/2] Fix dx build cmd --- docs-src/0.5/en/cookbook/publishing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-src/0.5/en/cookbook/publishing.md b/docs-src/0.5/en/cookbook/publishing.md index ad8108eed..760fdff14 100644 --- a/docs-src/0.5/en/cookbook/publishing.md +++ b/docs-src/0.5/en/cookbook/publishing.md @@ -27,7 +27,7 @@ dx build --release - Push to GitHub ## Web: Publishing with Netlify -Set your Netlify build command to `cargo install dioxus-cli && dx build —release`. +Set your Netlify build command to `cargo install dioxus-cli && dx build --release`. If you're using `dioxus-router`, you can configure Netlify to redirect all routes to your own `dioxus_router::Router` by creating the following `Netlify.toml` in your app's root directoy: ```toml