Skip to content

Commit

Permalink
locked install, compile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jkelleyrtp committed Nov 1, 2024
1 parent a6a3e38 commit d109b2f
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# - name: Install CLI
# run: cargo binstall dioxus-cli -y --force
- name: Install CLI
run: cargo install --force --git https://github.com/DioxusLabs/dioxus dioxus-cli
run: cargo install --force --git https://github.com/DioxusLabs/dioxus dioxus-cli --locked
- name: Build
run: DIOXUS_LOG=dx=trace dx build --platform web --ssg --profile release-tiny
- name: Copy output
Expand Down
2 changes: 1 addition & 1 deletion docs-src/0.5/en/router/reference/history-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ By default, the router uses the [`MemoryHistory`]. It might be changed to use
You can override the default history:

```rust
{{#include src/doc_examples/history_provider.rs:app}}
{{#include src/doc_examples/untested_05/history_provider.rs:app}}
```

8 changes: 6 additions & 2 deletions src/doc_examples/history_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ enum Route {
// ANCHOR: app
#[component]
fn App() -> Element {
rsx! {Router::<Route> { config: || RouterConfig::default().history(WebHistory::default()) }}
rsx! {
Router::<Route> { config: || RouterConfig::default() }
}
}
// ANCHOR_END: app

#[component]
fn Home() -> Element {
rsx! { h1 { "Welcome to the Dioxus Blog!" } }
rsx! {
h1 { "Welcome to the Dioxus Blog!" }
}
}

fn main() {}
8 changes: 6 additions & 2 deletions src/doc_examples/router_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ enum Route {
// ANCHOR: app
#[component]
fn App() -> Element {
rsx! {Router::<Route> { config: || RouterConfig::default().history(WebHistory::default()) }}
rsx! {
Router::<Route> { config: || RouterConfig::default() }
}
}
// ANCHOR_END: app

// ANCHOR: home
#[component]
fn Home() -> Element {
rsx! { h1 { "Welcome to the Dioxus Blog!" } }
rsx! {
h1 { "Welcome to the Dioxus Blog!" }
}
}
// ANCHOR_END: home

Expand Down
23 changes: 23 additions & 0 deletions src/doc_examples/untested_05/history_provider.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#![allow(non_snake_case)]
use dioxus::prelude::*;
use dioxus_router::prelude::*;

#[derive(Routable, Clone)]
enum Route {
#[route("/")]
Home {},
}

// ANCHOR: app
#[component]
fn App() -> Element {
rsx! {Router::<Route> { config: || RouterConfig::default().history(WebHistory::default()) }}
}
// ANCHOR_END: app

#[component]
fn Home() -> Element {
rsx! { h1 { "Welcome to the Dioxus Blog!" } }
}

fn main() {}
29 changes: 29 additions & 0 deletions src/doc_examples/untested_05/router_cfg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// ANCHOR: router
#![allow(non_snake_case)]
use dioxus::prelude::*;
use dioxus_router::prelude::*;

/// An enum of all of the possible routes in the app.
#[derive(Routable, Clone)]
enum Route {
// The home page is at the / route
#[route("/")]
Home {},
}
// ANCHOR_END: router

// ANCHOR: app
#[component]
fn App() -> Element {
rsx! {Router::<Route> { config: || RouterConfig::default().history(WebHistory::default()) }}
}
// ANCHOR_END: app

// ANCHOR: home
#[component]
fn Home() -> Element {
rsx! { h1 { "Welcome to the Dioxus Blog!" } }
}
// ANCHOR_END: home

fn main() {}
7 changes: 7 additions & 0 deletions src/docs/router_05.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5219,6 +5219,13 @@ pub fn ReferenceRsx() -> dioxus::prelude::Element {
name: "hello_world_desktop.rs".to_string(),
}
DemoFrame { rsx_overview::ConditionalAttributes {} }
p {
"Repeating an attribute joins the values with a space. This makes it easy to add values like classes conditionally:"
}
CodeBlock {
contents: "<pre style=\"background-color:#0d0d0d;\">\n<span style=\"font-style:italic;color:#66d9ef;\">let</span><span style=\"color:#f8f8f2;\"> large_font </span><span style=\"color:#f92672;\">= </span><span style=\"color:#ff80f4;\">true</span><span style=\"color:#f8f8f2;\">;\n</span><span style=\"color:#f8f8f2;\">rsx! {{\n</span><span style=\"color:#f8f8f2;\"> div {{\n</span><span style=\"color:#f8f8f2;\"> class: </span><span style=\"color:#ffee99;\">&quot;base-class another-class&quot;</span><span style=\"color:#f8f8f2;\">,\n</span><span style=\"color:#f8f8f2;\"> class: </span><span style=\"color:#f92672;\">if</span><span style=\"color:#f8f8f2;\"> large_font {{ </span><span style=\"color:#ffee99;\">&quot;text-xl&quot; </span><span style=\"color:#f8f8f2;\">}},\n</span><span style=\"color:#f8f8f2;\"> </span><span style=\"color:#ffee99;\">&quot;Hello, World!&quot;\n</span><span style=\"color:#f8f8f2;\"> }}\n</span><span style=\"color:#f8f8f2;\">}}</span></pre>\n",
name: "hello_world_desktop.rs".to_string(),
}
h4 { id: "custom-attributes",
a { href: "#custom-attributes", class: "header", "Custom Attributes" }
}
Expand Down

0 comments on commit d109b2f

Please sign in to comment.