diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..9a9eac2 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,85 @@ +name: CI + +on: + pull_request: + branches: [main] + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + line-endings: + name: Line endings (LF only) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install dos2unix + run: sudo apt-get update && sudo apt-get install -y dos2unix + + - name: Check that all tracked text files use LF + run: | + # dos2unix -ic lists files that contain CR characters. + # We feed it every text file tracked by git (-I excludes binary files in grep, + # and git's --eol filter would also work, but -ic is the canonical dos2unix check). + offenders=$(git ls-files -z | xargs -0 dos2unix -ic 2>/dev/null || true) + if [ -n "$offenders" ]; then + echo "::error::The following files contain CRLF or CR line endings; run dos2unix on them:" + printf '%s\n' "$offenders" + exit 1 + fi + echo "All tracked files use LF line endings." + + formatting: + name: leptosfmt --check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install stable Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo bin + uses: actions/cache@v4 + with: + path: ~/.cargo/bin + key: cargo-bin-leptosfmt-0.1.33 + + - name: Install leptosfmt + run: | + if ! command -v leptosfmt >/dev/null 2>&1; then + cargo install leptosfmt --version 0.1.33 --locked + fi + + - name: Run leptosfmt --check + run: leptosfmt --check src + + build: + name: Trunk build + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + + - name: Install nightly Rust + uses: dtolnay/rust-toolchain@nightly + with: + targets: wasm32-unknown-unknown + + - name: Cache cargo registry and target + uses: Swatinem/rust-cache@v2 + + - name: Install Trunk + run: | + wget -qO- https://github.com/trunk-rs/trunk/releases/download/v0.21.14/trunk-x86_64-unknown-linux-gnu.tar.gz \ + | tar -xzf- -C /usr/local/bin + + - name: Build with Trunk + run: trunk build --release diff --git a/Cargo.lock b/Cargo.lock index f9cb7fc..96d6379 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,15 +116,6 @@ version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -[[package]] -name = "cc" -version = "1.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" -dependencies = [ - "shlex", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -959,16 +950,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "minicov" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b" -dependencies = [ - "cc", - "walkdir", -] - [[package]] name = "next_tuple" version = "0.1.0" @@ -1004,7 +985,6 @@ dependencies = [ "leptos_meta", "leptos_router", "wasm-bindgen", - "wasm-bindgen-test", "web-sys", ] @@ -1468,12 +1448,6 @@ dependencies = [ "syn", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - [[package]] name = "slab" version = "0.4.9" @@ -1835,30 +1809,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "wasm-bindgen-test" -version = "0.3.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c8d5e33ca3b6d9fa3b4676d774c5778031d27a578c2b007f905acf816152c3" -dependencies = [ - "js-sys", - "minicov", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test-macro", -] - -[[package]] -name = "wasm-bindgen-test-macro" -version = "0.3.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17d5042cc5fa009658f9a7333ef24291b1291a25b6382dd68862a7f3b969f69b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "wasm-streams" version = "0.4.2" diff --git a/Cargo.toml b/Cargo.toml index e2504db..da0833d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,10 +11,5 @@ leptos_router = "0.8.2" wasm-bindgen = "0.2.100" web-sys = { version = "0.3.77", features = ["Document", "Window", "console"] } -[dev-dependencies] -wasm-bindgen = "0.2.100" -wasm-bindgen-test = "0.3.50" -web-sys = { version = "0.3.77", features = ["Document", "Window", "console"] } - [package.metadata.leptos] assets-dir="public" \ No newline at end of file diff --git a/Readme.md b/Readme.md index 1d5c05f..3b7823b 100644 --- a/Readme.md +++ b/Readme.md @@ -1,63 +1,63 @@ -# OpenDevicePartnership.github.io - -Website for the Open Device Partnership, built with Rust, Leptos, and Trunk. - -## Prerequisites - -Before running this project, ensure you have the following installed: - -1. **Rust** - Install from [https://rustup.rs/](https://rustup.rs/) - -2. **Trunk** - Build tool for Rust web applications - - ```cmd - cargo binstall trunk or - cargo install trunk - ``` - -3. **WebAssembly target** - Required for compiling to WASM - - ```cmd - rustup target add wasm32-unknown-unknown - ``` - -## Development - -To run the development server: - -```cmd -trunk serve -``` - -This will: - -- Build the project in debug mode -- Start a development server at -- Watch for file changes and auto-reload the browser - -## Production Build - -To build for production: - -```cmd -trunk build --release -``` - -The optimized output will be generated in the `dist/` directory. - -## Project Structure - -- `src/` - Rust source code - - `components/` - Reusable UI components - - `pages/` - Page components -- `style/` - CSS files (Tailwind) -- `public/` - Static assets (images, etc.) -- `index.html` - Main HTML template -- `Trunk.toml` - Trunk configuration -- `Cargo.toml` - Rust dependencies - -## Technology Stack - -- **Leptos** - Reactive web framework for Rust -- **Trunk** - WASM web application bundler -- **Tailwind CSS** - Utility-first CSS framework +# OpenDevicePartnership.github.io + +Website for the Open Device Partnership, built with Rust, Leptos, and Trunk. + +## Prerequisites + +Before running this project, ensure you have the following installed: + +1. **Rust** - Install from [https://rustup.rs/](https://rustup.rs/) + +2. **Trunk** - Build tool for Rust web applications + + ```cmd + cargo binstall trunk or + cargo install trunk + ``` + +3. **WebAssembly target** - Required for compiling to WASM + + ```cmd + rustup target add wasm32-unknown-unknown + ``` + +## Development + +To run the development server: + +```cmd +trunk serve +``` + +This will: + +- Build the project in debug mode +- Start a development server at +- Watch for file changes and auto-reload the browser + +## Production Build + +To build for production: + +```cmd +trunk build --release +``` + +The optimized output will be generated in the `dist/` directory. + +## Project Structure + +- `src/` - Rust source code + - `components/` - Reusable UI components + - `pages/` - Page components +- `style/` - CSS files (Tailwind) +- `public/` - Static assets (images, etc.) +- `index.html` - Main HTML template +- `Trunk.toml` - Trunk configuration +- `Cargo.toml` - Rust dependencies + +## Technology Stack + +- **Leptos** - Reactive web framework for Rust +- **Trunk** - WASM web application bundler +- **Tailwind CSS** - Utility-first CSS framework diff --git a/gh-public/404.html b/gh-public/404.html index feed737..3c49f34 100644 --- a/gh-public/404.html +++ b/gh-public/404.html @@ -1,10 +1,10 @@ - - - - - Redirecting... - - - We couldn't find this page. Redirecting you to https://opendevicepartnership.org/ - + + + + + Redirecting... + + + We couldn't find this page. Redirecting you to https://opendevicepartnership.org/ + \ No newline at end of file diff --git a/gh-public/boot-firmware/index.html b/gh-public/boot-firmware/index.html index a846cd5..34a5b29 100644 --- a/gh-public/boot-firmware/index.html +++ b/gh-public/boot-firmware/index.html @@ -1,10 +1,10 @@ - - - - - Redirecting... - - - This page has moved to https://opendevicepartnership.org/boot-firmware. You will be automatically redirected.

- + + + + + Redirecting... + + + This page has moved to https://opendevicepartnership.org/boot-firmware. You will be automatically redirected.

+ \ No newline at end of file diff --git a/gh-public/community/index.html b/gh-public/community/index.html index a0d6bf4..f6859ed 100644 --- a/gh-public/community/index.html +++ b/gh-public/community/index.html @@ -1,10 +1,10 @@ - - - - - Redirecting... - - - This page has moved to https://opendevicepartnership.org/community. You will be automatically redirected.

- + + + + + Redirecting... + + + This page has moved to https://opendevicepartnership.org/community. You will be automatically redirected.

+ \ No newline at end of file diff --git a/gh-public/embedded-controller/index.html b/gh-public/embedded-controller/index.html index 885a48e..8b3cb8d 100644 --- a/gh-public/embedded-controller/index.html +++ b/gh-public/embedded-controller/index.html @@ -1,10 +1,10 @@ - - - - - Redirecting... - - - This page has moved to https://opendevicepartnership.org/embedded-controller. You will be automatically redirected.

- + + + + + Redirecting... + + + This page has moved to https://opendevicepartnership.org/embedded-controller. You will be automatically redirected.

+ \ No newline at end of file diff --git a/gh-public/getting-started/index.html b/gh-public/getting-started/index.html index 093e288..a4309ea 100644 --- a/gh-public/getting-started/index.html +++ b/gh-public/getting-started/index.html @@ -1,10 +1,10 @@ - - - - - Redirecting... - - - This page has moved to https://opendevicepartnership.org/getting-started. You will be automatically redirected.

- + + + + + Redirecting... + + + This page has moved to https://opendevicepartnership.org/getting-started. You will be automatically redirected.

+ \ No newline at end of file diff --git a/gh-public/home/index.html b/gh-public/home/index.html index 9820b53..305c643 100644 --- a/gh-public/home/index.html +++ b/gh-public/home/index.html @@ -1,10 +1,10 @@ - - - - - Redirecting... - - - This page has moved to https://opendevicepartnership.org/home. You will be automatically redirected.

- + + + + + Redirecting... + + + This page has moved to https://opendevicepartnership.org/home. You will be automatically redirected.

+ \ No newline at end of file diff --git a/gh-public/index.html b/gh-public/index.html index d2f761d..4caca6d 100644 --- a/gh-public/index.html +++ b/gh-public/index.html @@ -1,10 +1,10 @@ - - - - - Redirecting... - - - This page has moved to https://opendevicepartnership.org/. You will be automatically redirected.

- + + + + + Redirecting... + + + This page has moved to https://opendevicepartnership.org/. You will be automatically redirected.

+ \ No newline at end of file diff --git a/gh-public/projects/index.html b/gh-public/projects/index.html index eb2c6b3..dd81c38 100644 --- a/gh-public/projects/index.html +++ b/gh-public/projects/index.html @@ -1,10 +1,10 @@ - - - - - Redirecting... - - - This page has moved to https://opendevicepartnership.org/projects. You will be automatically redirected.

- + + + + + Redirecting... + + + This page has moved to https://opendevicepartnership.org/projects. You will be automatically redirected.

+ \ No newline at end of file diff --git a/gh-public/windows-ec-services/index.html b/gh-public/windows-ec-services/index.html index a52ef3d..1811e67 100644 --- a/gh-public/windows-ec-services/index.html +++ b/gh-public/windows-ec-services/index.html @@ -1,10 +1,10 @@ - - - - - Redirecting... - - - This page has moved to https://opendevicepartnership.org/windows-ec-services. You will be automatically redirected.

- + + + + + Redirecting... + + + This page has moved to https://opendevicepartnership.org/windows-ec-services. You will be automatically redirected.

+ \ No newline at end of file diff --git a/public/images/dark/backbutton.svg b/public/images/dark/backbutton.svg index 4f2e9d1..00c08a1 100644 --- a/public/images/dark/backbutton.svg +++ b/public/images/dark/backbutton.svg @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/public/images/light/backbutton.svg b/public/images/light/backbutton.svg index af8c489..d603d4c 100644 --- a/public/images/light/backbutton.svg +++ b/public/images/light/backbutton.svg @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/public/images/patina_header.svg b/public/images/patina_header.svg index cba7041..4de9850 100644 --- a/public/images/patina_header.svg +++ b/public/images/patina_header.svg @@ -1,35 +1,35 @@ - - - - - - - - -
-
-
- - - - -
- - - - - - - - - - - - - - - - - - -
+ + + + + + + + +
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + +
diff --git a/src/components/announce_banner.rs b/src/components/announce_banner.rs index 46b01f3..9ae7cd3 100644 --- a/src/components/announce_banner.rs +++ b/src/components/announce_banner.rs @@ -4,11 +4,19 @@ use leptos::prelude::*; pub fn AnnounceBanner() -> impl IntoView { view! {
- Flag Icon - + Flag Icon + {"UPDATE: "} {"Open Device Partnership Expands Open-Source Efforts; "} - + {"Patina Project to Launch at UEFI 2025 Developer Conference & Plugfest - read more!"} diff --git a/src/components/community_teams.rs b/src/components/community_teams.rs index 75804f4..8c43e6b 100644 --- a/src/components/community_teams.rs +++ b/src/components/community_teams.rs @@ -1,4 +1,5 @@ use crate::components::team_grid::{TeamGrid, TeamMember}; +use crate::components::themed_icon::ThemedIcon; use leptos::prelude::*; fn create_steering_committee() -> Vec { @@ -35,90 +36,73 @@ pub fn CommunityTeams() -> impl IntoView { let steering_committee = create_steering_committee(); view! { -
- {/* Row 2: Two Columns */} -
+
+
- + {"How ODP is built by its community"}
- + {"The Open Device Partnership (ODP) is a collaborative open-source initiative designed to promote cooperative innovation in firmware development through contribution and transparency."} -
-
+

{"To support this vision, ODP has adopted a lightweight yet formal governance model that clarifies how decisions are made, how contributions are recognized, and how the community remains focused on shared goals."} -
-
+

{"Like most open-source communities, the ODP governance model consists of a group of core maintainers that are responsible for guiding the technical direction of the project known as the \"Technical Steering Committee\" (TSC). Members are typically industry-experienced contributors nominated by the community members or its sponsors."} -
+
{"The model also provides for certain \"Working Groups\", which are task-focused teams that handle the development or specification within a particular area of concern (for example, Patina, EC Services)."} -
+
{"Decisions are made via public discussion followed by majority vote among TSC members."} -
+
{"All official actions, road maps, and meeting notes are transparently published, and all project materials are hosted openly on GitHub."} -
-
+

{"For more information, see the complete governance policies at the "} - {"ODP Governance Repository"} - {", or join the discussion on our public chat on "} - {"Zulip"} - {"."} + + {"ODP Governance Repository"} + {", or join the discussion on our public chat on "} + + {"Zulip"} + {"."}
- - {/* Row 3: Teams Image */} -
- - - Teams - +
+ {"Steering Committee"}
- - {/* Row 4: Steering Committee Members */} - - {/* Row 5: Teams Label */} -
+
{"Teams"}
- - {/* Row 6: Teams */}
-
- +
+ {"Boot Firmware (Patina)"} - + {"Developing and managing development of a new modern UEFI"}
@@ -126,24 +110,21 @@ pub fn CommunityTeams() -> impl IntoView { href="/team-patina" class="odp-btn odp-btn-text" style=" - margin-top: auto; - text-decoration: none; + margin-top: auto; + text-decoration: none; " > {"Members + Contacts"}
-
- +
+ {"Secure Embedded Controller"} - + {"Developing and managing secure EC internals"}
@@ -151,24 +132,21 @@ pub fn CommunityTeams() -> impl IntoView { href="/team-ec" class="odp-btn odp-btn-text" style=" - margin-top: auto; - text-decoration: none; + margin-top: auto; + text-decoration: none; " > {"Members + Contacts"}
-
- +
+ {"Unified EC Services"} - + {"Designing and managing implementation of a unified EC Services interface"}
@@ -176,8 +154,8 @@ pub fn CommunityTeams() -> impl IntoView { href="team-ec-services" class="odp-btn odp-btn-text" style=" - margin-top: auto; - text-decoration: none; + margin-top: auto; + text-decoration: none; " > {"Members + Contacts"} diff --git a/src/components/documentation_training.rs b/src/components/documentation_training.rs index c6ebe8d..8958c52 100644 --- a/src/components/documentation_training.rs +++ b/src/components/documentation_training.rs @@ -1,3 +1,4 @@ +use crate::components::themed_icon::ThemedIcon; use leptos::prelude::*; use leptos_router::components::A; @@ -8,65 +9,98 @@ pub struct DocLink { pub external: bool, } +/// Canonical "Documentation" link list shown at the bottom of every +/// content page. Pages typically render `` +/// with no `links` prop so they pick up this default; pass an explicit +/// `links=...` only when a page needs a different set. +pub const DEFAULT_DOC_LINKS: &[DocLink] = &[ + DocLink { + href: "https://opendevicepartnership.github.io/documentation/guide/why/why.html", + title: "Why ODP?", + external: true, + }, + DocLink { + href: "https://opendevicepartnership.github.io/documentation/guide/intro/getting_started.html", + title: "Getting Started with ODP", + external: true, + }, + DocLink { + href: "https://opendevicepartnership.github.io/documentation/guide/intro/welcome.html", + title: "Tutorials", + external: true, + }, + DocLink { + href: "https://opendevicepartnership.github.io/documentation/guide/specs/specifications.html", + title: "Specifications", + external: true, + }, + DocLink { + href: "/community", + title: "Contributing to ODP", + external: false, + }, +]; + #[component] -pub fn DocumentationTraining(#[prop(default = vec![])] links: Vec) -> impl IntoView { +pub fn DocumentationTraining(#[prop(default = DEFAULT_DOC_LINKS.to_vec())] links: Vec) -> impl IntoView { view! { -
- {/* Left: Image and text box */} +
- - - Documentation Icon - - - "Documentation" - + + "Documentation"
- - "Start developing with ODP" - + "Start developing with ODP"
- - {/* Spacer between left and right */} - - {/* Right: List of hyperlinks */}
+ {links + .into_iter() + .map(|link| { + view! { +
  • + + + {"→ "} + + {link.title} + + +
  • + } + } + > + + + } - > - - - - }).collect_view()} + }) + .collect_view()}
    } diff --git a/src/components/footer.rs b/src/components/footer.rs index 71abf4b..87e75c6 100644 --- a/src/components/footer.rs +++ b/src/components/footer.rs @@ -1,19 +1,17 @@ +use crate::components::themed_icon::ThemedIcon; use leptos::prelude::*; #[component] pub fn Footer() -> impl IntoView { view! { -