diff --git a/.env b/.env
new file mode 100644
index 0000000..748cb1e
--- /dev/null
+++ b/.env
@@ -0,0 +1 @@
+BASENAME=
\ No newline at end of file
diff --git a/.gh-pages.env b/.gh-pages.env
new file mode 100644
index 0000000..e87b027
--- /dev/null
+++ b/.gh-pages.env
@@ -0,0 +1 @@
+BASENAME=/sql-mermaid
diff --git a/.github/workflows/continuous_deployment.yml b/.github/workflows/continuous_deployment.yml
index d1aefba..221bb46 100644
--- a/.github/workflows/continuous_deployment.yml
+++ b/.github/workflows/continuous_deployment.yml
@@ -16,6 +16,7 @@ jobs:
version: 'latest'
- name: Build
run: |
+ cp .gh-pages.env .env
npm install
npm run build
- name: Package
@@ -38,6 +39,6 @@ jobs:
- name: Deploy demo
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
- branch: main
+ branch: gh-pages
folder: dist
clean: true
\ No newline at end of file
diff --git a/Cargo.toml b/Cargo.toml
index 11a021b..a233810 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,6 +27,7 @@ web-sys = "0.3.60"
gloo-utils = "0.1.5"
clap = { version = "3.0.14", features = ["derive"] }
material-yew = { version = "0.2.0" , features = ["button", "textarea", "top-app-bar", "tabs", "top-app-bar-fixed"] }
+dotenv_codegen = "0.15.0"
[dev-dependencies]
wasm-bindgen-test = "0.3.14"
diff --git a/src/app.rs b/src/app.rs
index c27c30a..ffc721e 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -8,9 +8,11 @@ use crate::routes::{switch, AppRoute};
#[function_component(App)]
pub fn app() -> Html {
html! {
-
-
- render={Switch::render(switch)} />
-
- }
+ // wait for yew 0.20
+ //
+
+
+ render={Switch::render(switch)} />
+
+ }
}
diff --git a/src/lib.rs b/src/lib.rs
index 089950c..04076ee 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,6 @@
+#[macro_use]
+extern crate dotenv_codegen;
+
pub mod app;
pub mod components;
pub mod routes;
diff --git a/src/routes/mod.rs b/src/routes/mod.rs
index 77f1df3..1381a7f 100644
--- a/src/routes/mod.rs
+++ b/src/routes/mod.rs
@@ -8,6 +8,7 @@ use about::About;
use home::Home;
/// App routes
+// wait yew 0.20 to remove pages base name
#[derive(Routable, Debug, Clone, PartialEq)]
pub enum AppRoute {
#[at("/about")]
@@ -17,12 +18,16 @@ pub enum AppRoute {
PageNotFound,
#[at("/")]
Home,
+ // remove when yew 0.20
+ #[at("/sql-mermaid")]
+ AlsoHome,
}
/// Switch app routes
pub fn switch(routes: &AppRoute) -> Html {
match routes.clone() {
AppRoute::Home => html! { },
+ AppRoute::AlsoHome => html! { },
AppRoute::About => html! { },
AppRoute::PageNotFound => html! { "Page not found" },
}