diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index b79eed9..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "rust-analyzer.rustfmt.overrideCommand": [ - "leptosfmt", - "--stdin", - "--rustfmt" - ], - "editor.formatOnSave": true, - "[rust]": { - "editor.defaultFormatter": "rust-lang.rust-analyzer", - }, - "files.associations": { - "*.rs": "rust" - }, -} \ No newline at end of file diff --git a/Cargo.nightly.toml b/Cargo.nightly.toml index c12b5b6..a8b56e0 100644 --- a/Cargo.nightly.toml +++ b/Cargo.nightly.toml @@ -24,6 +24,15 @@ wasm-bindgen = "0.2" wasm-bindgen-test = "0.3" web-sys = { version = "0.3", features = ["Document", "Window"] } +# [profile.dev] +# incremental = true +# opt-level = 0 +# debug = 1 # Reduce debug info +# lto = false + +# [profile.dev.package."*"] +# opt-level = 3 # optimize dependencies aggressively +# debug = 1 # we don’t need much debug info for dependencies [profile.release] opt-level = 'z' diff --git a/Cargo.stable.toml b/Cargo.stable.toml index 72cd0d9..9e27f4b 100644 --- a/Cargo.stable.toml +++ b/Cargo.stable.toml @@ -24,6 +24,15 @@ wasm-bindgen = "0.2" wasm-bindgen-test = "0.3" web-sys = { version = "0.3", features = ["Document", "Window"] } +# [profile.dev] +# incremental = true +# opt-level = 0 +# debug = 1 # Reduce debug info +# lto = false + +# [profile.dev.package."*"] +# opt-level = 3 # optimize dependencies aggressively +# debug = 1 # we don’t need much debug info for dependencies [profile.release] opt-level = 'z' diff --git a/README.md b/README.md index ee4f8bb..572c612 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ cargo install cargo-generate trunk leptosfmt To set up your project with this template, run ```sh -cargo generate --git https://github.com/leptos-community/start-trunk +cargo generate --git https://github.com/leptos-rs/start-trunk ``` to generate your new project, then diff --git a/Trunk.toml b/Trunk.toml index a669c48..0894efa 100644 --- a/Trunk.toml +++ b/Trunk.toml @@ -1,3 +1,9 @@ +# An example Trunk.toml with all possible fields along with their defaults. +# This file is taken from https://github.com/trunk-rs/trunk/blob/main/Trunk.toml + +# A sem-ver version requirement of trunk required for this project +trunk-version = "*" + [build] # The index HTML file to drive the bundling process. target = "index.html" @@ -25,6 +31,8 @@ inject_scripts = true # no_sri = false # An optional cargo profile to use # cargo_profile = "release-trunk" +# Allow injecting a nonce attribute +# create_nonce = false [watch] # Paths to watch. The `build.target`'s parent folder is watched by default. @@ -58,3 +66,40 @@ open = false # tls_cert_path = "self_signed_certs/cert.pem" # Additional headers to send. NOTE: header names must be valid HTTP headers. # headers = { "X-Foo" = "bar" } + +[clean] +# Optionally perform a cargo clean. +cargo = false + +[tools] +# Default dart-sass version to download. +# sass = "1.69.5" +# Default wasm-bindgen version to download. +# wasm_bindgen = "0.2.89" +# Default wasm-opt version to download. +# wasm_opt = "version_123" +# Default tailwindcss-cli version to download. +# tailwindcss = "3.3.5" + +## proxy +# Proxies are optional, and default to `None`. +# Proxies are only run as part of the `trunk serve` command. + +# [[proxy]] +# This WebSocket proxy example has a backend and ws field. This example will listen for +# WebSocket connections at `/api/ws` and proxy them to `ws://localhost:9000/api/ws`. +# backend = "ws://localhost:9000/api/ws" +# ws = true + + +## hooks +# Hooks are optional, and default to `None`. +# Hooks are executed as part of Trunk's main build pipeline, no matter how it is run. + +# [[hooks]] +# This hook example shows all the current available fields. It will execute the equivalent of +# typing "echo Hello Trunk!" right at the start of the build process (even before the HTML file +# is read). By default, the command is spawned directly and no shell is used. +# stage = "pre_build" +# command = "echo" +# command_arguments = ["Hello", "Trunk!"] diff --git a/cargo-generate.toml b/cargo-generate.toml index 9fdeb7f..b3dc547 100644 --- a/cargo-generate.toml +++ b/cargo-generate.toml @@ -7,10 +7,10 @@ default_channel = { prompt = "Use stable or nightly channel?", choices = [ "stable", "nightly", ], default = "stable", type = "string" } -vscode_settings = { prompt = "Generate default VS Code settings?", default = false, type = "bool" } +rust_analyzer_settings = { prompt = "Override `rustfmt` with `leptosfmt`?", default = false, type = "bool" } -[conditional.'vscode_settings == false'] -ignore = [".vscode"] +[conditional.'rust_analyzer_settings == false'] +ignore = ["rust-analyzer.toml"] [hooks] pre = ["switch_nightly_stable.rhai"] diff --git a/rust-analyzer.toml b/rust-analyzer.toml new file mode 100644 index 0000000..9eab123 --- /dev/null +++ b/rust-analyzer.toml @@ -0,0 +1,2 @@ +[rustfmt] +overrideCommand = ["leptosfmt", "--stdin", "--rustfmt"] diff --git a/src/lib.rs b/src/lib.rs index 923ba7b..658f368 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ mod components; mod pages; // Top-Level pages -use crate::pages::home::Home; +use crate::pages::{home::Home, not_found::NotFound}; /// An app router which renders the homepage and handles 404's #[component] @@ -26,7 +26,7 @@ pub fn App() -> impl IntoView { - + diff --git a/src/pages/not_found.rs b/src/pages/not_found.rs index ab89b42..d545979 100644 --- a/src/pages/not_found.rs +++ b/src/pages/not_found.rs @@ -3,5 +3,8 @@ use leptos::prelude::*; /// 404 Not Found Page #[component] pub fn NotFound() -> impl IntoView { - view! {

"Uh oh!"
"We couldn't find that page!"

} + view! { +

"404: Page not found"

+

"We couldn't find that page!"

+ } }