diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5084c931f..592ae70c6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,313 @@ jobs: - name: Check clippy run: cargo clippy --workspace -- -Dwarnings + + accessibility-linting: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Create Dummy Generated Pages + run: | + echo "Assets" + mkdir content/assets content/assets/placeholder + echo -e "+++\ntitle = \"Bevy Assets\"\ntemplate = \"assets.html\"\n+++\n" > content/assets/_index.md + echo -e "+++\ntitle = \"placeholder\"\n+++\n" > content/assets/placeholder/_index.md + echo -e "+++\ntitle = \"Example\"\ndescription = \"Example post of assets section of site.\"\n[extra]\nlink = \"https://example.com\"\nlicenses = [\"Example License\"]\nbevy_versions = [\"x.y.x\"]\n+++\n" > content/assets/placeholder/example.md + echo "Examples" + mkdir content/examples content/examples/2d_rendering content/examples/2d_rendering/2d-shapes + echo -e "+++\ntitle = \"Bevy Examples in WebGL2\"\ntemplate = \"examples.html\"\nsort_by = \"weight\"\n[extra]\nheader_message = \"Examples (WebGL2)\"\n+++\n" > content/examples/_index.md + echo -e "+++\ntitle = \"2D Rendering\"\nsort_by = \"weight\"\nweight = 15\n+++\n" > content/examples/2d_rendering/_index.md + echo -e "+++\ntitle = \"2D Shapes\"\ntemplate = \"example.html\"\nweight = 0\ndescription = \"Renders simple 2D primitive shapes like circles and polygons\"\n[extra]\ntechnical_name = \"2d-shapes\"\nlink = \"/examples/2d_rendering/2d-shapes\"\nimage = \"../static/screenshots/2d_rendering/2d_shapes.png\"\ncode_path = \"content/examples/2d_rendering/2d-shapes/2d_shapes.rs\"\ngithub_code_path = \"examples/2d/2d_shapes.rs\"\nheader_message = \"examples (WebGL2)\"\n+++\n" > content/examples/2d_rendering/2d-shapes/index.md + echo "//! Shows how to render simple primitive shapes with a single color. + use bevy::{ + prelude::*, + sprite::{MaterialMesh2dBundle, Mesh2dHandle}, + }; + fn main() { + App::new() + .add_plugins(DefaultPlugins) + .add_systems(Startup, setup) + .run(); + } + const X_EXTENT: f32 = 600.; + fn setup( + mut commands: Commands, + mut meshes: ResMut>, + mut materials: ResMut>, + ) { + commands.spawn(Camera2dBundle::default()); + let shapes = [ + Mesh2dHandle(meshes.add(Circle { radius: 50.0 })), + Mesh2dHandle(meshes.add(Ellipse::new(25.0, 50.0))), + Mesh2dHandle(meshes.add(Capsule2d::new(25.0, 50.0))), + Mesh2dHandle(meshes.add(Rectangle::new(50.0, 100.0))), + Mesh2dHandle(meshes.add(RegularPolygon::new(50.0, 6))), + Mesh2dHandle(meshes.add(Triangle2d::new( + Vec2::Y * 50.0, + Vec2::new(-50.0, -50.0), + Vec2::new(50.0, -50.0), + ))), + ]; + let num_shapes = shapes.len(); + for (i, shape) in shapes.into_iter().enumerate() { + // Distribute colors evenly across the rainbow. + let color = Color::hsl(360. * i as f32 / num_shapes as f32, 0.95, 0.7); + commands.spawn(MaterialMesh2dBundle { + mesh: shape, + material: materials.add(color), + transform: Transform::from_xyz( + // Distribute shapes from -X_EXTENT to +X_EXTENT. + -X_EXTENT / 2. + i as f32 / (num_shapes - 1) as f32 * X_EXTENT, + 0.0, + 0.0, + ), + ..default() + }); + } + }" > content/examples/2d_rendering/2d-shapes/2d_shapes.rs + echo "Community" + mkdir content/community/donate content/community/people content/community/people/'community members' content/community/people/'the bevy organization' + echo "Donation Page" + echo -e "+++ + title = \"Supporting Bevy Development\" + sort_by = \"weight\" + template = \"donate.html\" + weight = 1 + + [extra] + header_message = \"Supporting Bevy\" + sort_order_reversed = false + + +++ + " > content/community/donate/_index.md + echo -e "+++ + title = \"Test Person\" + weight = 0 + + [extra] + profile_picture = \"\" + sponsor = \"nothing\" + bio = \"Test person.\" + discord = \"test#9999\" + discord_userid = \"000000000000000000\" + github = \"invalid\" + mastodon_user = \"invalid\" + mastodon_instance = \"doesnt.exist\" + twitter = \"nothing\" + itch_io = \"nada\" + roles = [\"Non-existent\"] + + +++ + " > content/community/donate/test.md + echo "People Page" + echo -e "+++ + title = \"People\" + sort_by = \"weight\" + template = \"people.html\" + weight = 0 + + [extra] + header_message = \"People\" + sort_order_reversed = false + + +++ + " > content/community/people/_index.md + echo -e "+++ + title = \"Community Members\" + sort_by = \"weight\" + weight = 2 + + [extra] + sort_order_reversed = false + + +++ + " > content/community/people/'community members'/_index.md + echo -e "+++ + title = \"Test Person\" + weight = 0 + + [extra] + profile_picture = \"\" + sponsor = \"nothing\" + bio = \"Tester\" + discord = \"test\" + discord_userid = \"000000000000000000\" + github = \"test\" + itch_io = \"test\" + website = \"https://example.com\" + + +++ + " > content/community/people/'community members'/test.md + echo -e "+++ + title = \"The Bevy Organization\" + sort_by = \"weight\" + weight = 1 + + [extra] + sort_order_reversed = false + + +++ + " > content/community/people/'the bevy organization'/_index.md + echo -e "+++ + title = \"Test Member\" + weight = 0 + + [extra] + profile_picture = \"\" + bio = \"Test person.\" + discord = \"test#9999\" + discord_userid = \"000000000000000000\" + github = \"invalid\" + mastodon_user = \"invalid\" + mastodon_instance = \"doesnt.exist\" + twitter = \"nothing\" + itch_io = \"nada\" + roles = [\"Non-existent\"] + + +++ + " > content/community/people/'the bevy organization'/test.md + echo "Errors" + mkdir content/learn/errors + echo -e "+++ + title = \"Errors\" + sort_by = \"weight\" + template = \"errors.html\" + weight = 0 + + [extra] + header_message = \"Errors\" + sort_order_reversed = false + + +++ + " > content/learn/errors/_index.md + echo -e "+++ + title = \"B0001\" + weight = 0 + + +++ + + + To keep [Rust rules on references](https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#the-rules-of-references) (either one mutable reference or any number of immutable references) on a component, it is not possible to have two queries on the same component when one requests mutable access to it in the same system. + + Erroneous code example: + + ```rust + use bevy::prelude::*; + + #[derive(Component)] + struct Player; + + #[derive(Component)] + struct Enemy; + + fn move_enemies_to_player( + mut enemies: Query<&mut Transform, With>, + player: Query<&Transform, With>, + ) { + // ... + } + + fn main() { + App::new() + .add_plugins(DefaultPlugins) + .add_systems(Update, move_enemies_to_player) + .run(); + } + ``` + + This will panic, as it's not possible to have both a mutable and an immutable query on `Transform` at the same time. + + You have two solutions: + + Solution #1: use disjoint queries using [`Without`] + + As a `Player` entity won't be an `Enemy` at the same time, those two queries will actually never target the same entity. This can be encoded in the query filter with [`Without`] : + + [`Without`]: https://docs.rs/bevy/latest/bevy/ecs/query/struct.Without.html + ```rust + use bevy::prelude::*; + + #[derive(Component)] + struct Player; + + #[derive(Component)] + struct Enemy; + + fn move_enemies_to_player( + mut enemies: Query<&mut Transform, With>, + player: Query<&Transform, (With, Without)>, + ) { + // ... + } + + fn main() { + App::new() + .add_plugins(DefaultPlugins) + .add_systems(Update, move_enemies_to_player) + .run(); + } + ``` + + Solution #2: use a `ParamSet` + + A `ParamSet` will let you have conflicting queries as a parameter, but you will still be responsible for not using them at the same time in your system. + + ```rust + use bevy::prelude::*; + + #[derive(Component)] + struct Player; + + #[derive(Component)] + struct Enemy; + + fn move_enemies_to_player( + mut transforms: ParamSet<( + Query<&mut Transform, With>, + Query<&Transform, With>, + )>, + ) { + // ... + } + + fn main() { + App::new() + .add_plugins(DefaultPlugins) + .add_systems(Update, move_enemies_to_player) + .run(); + } + ``` + " > content/learn/errors/test_error.md + + - name: Install NPM + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install Google Chrome + run: | + sudo apt-get install -y chromium-browser + which chromium-browser + chromium-browser --version + + - name: Install Zola + uses: taiki-e/install-action@v2 + with: + tool: zola@0.18.0 + + - name: Install Pa11y-CI and Wait-on + run: | + npm install pa11y-ci wait-on + node node_modules/puppeteer/install.js + + - name: Run Pa11y-CI + run: | + echo -e "{\n \"defaults\": {\n \"chromeLaunchConfig\": {\n \"executablePath\": \"/usr/bin/chromium-browser\"\n }\n }\n}" > .pa11yci + zola serve & + npx wait-on http://127.0.0.1:1111 + npx pa11y-ci --sitemap http://127.0.0.1:1111/sitemap.xml --sitemap-exclude 'faq' typos: runs-on: ubuntu-latest @@ -81,7 +388,7 @@ jobs: echo 'You can find the extension here: https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode' generate-assets: - needs: [mega-linter, test-code-examples, lint-tools, check-hide-lines, typos] + needs: [mega-linter, test-code-examples, lint-tools, check-hide-lines, typos, accessibility-linting] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -116,7 +423,7 @@ jobs: retention-days: 1 generate-errors: - needs: [mega-linter, test-code-examples, lint-tools, check-hide-lines, typos] + needs: [mega-linter, test-code-examples, lint-tools, check-hide-lines, typos, accessibility-linting] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -143,7 +450,7 @@ jobs: retention-days: 1 generate-wasm-examples: - needs: [mega-linter, test-code-examples, lint-tools, check-hide-lines, typos] + needs: [mega-linter, test-code-examples, lint-tools, check-hide-lines, typos, accessibility-linting] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -170,7 +477,7 @@ jobs: retention-days: 1 generate-community: - needs: [mega-linter, test-code-examples, lint-tools, check-hide-lines, typos] + needs: [mega-linter, test-code-examples, lint-tools, check-hide-lines, typos, accessibility-linting] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -198,7 +505,7 @@ jobs: build-website: runs-on: ubuntu-latest - needs: [mega-linter, test-code-examples, lint-tools, check-hide-lines, typos, generate-assets, generate-errors, generate-wasm-examples, generate-community] + needs: [mega-linter, test-code-examples, lint-tools, check-hide-lines, typos, accessibility-linting, generate-assets, generate-errors, generate-wasm-examples, generate-community] steps: - uses: actions/checkout@v4 diff --git a/content/learn/migration-guides/0.12-to-0.13.md b/content/learn/migration-guides/0.12-to-0.13.md index 65cb0fae4a..4e91536258 100644 --- a/content/learn/migration-guides/0.12-to-0.13.md +++ b/content/learn/migration-guides/0.12-to-0.13.md @@ -102,7 +102,7 @@ This means users who want to migrate their .meta files will have to add the `inc - For `add_texture` you need to wrap your `AssetId` in `Some` -- `finish` now returns the atlas texture image directly instead of a handle. Provide the atlas texture to `add` on Assets to get a Handle +- `finish` now returns the atlas texture image directly instead of a handle. Provide the atlas texture to `add` on `Assets` to get a `Handle` ### [Remove the ability to ignore global volume](https://github.com/bevyengine/bevy/pull/11092) diff --git a/content/news/2020-08-10-introducing-bevy/index.md b/content/news/2020-08-10-introducing-bevy/index.md index 7b6a551cf9..fe038e75db 100644 --- a/content/news/2020-08-10-introducing-bevy/index.md +++ b/content/news/2020-08-10-introducing-bevy/index.md @@ -1198,4 +1198,4 @@ If any of this sounds interesting to you, I encourage you to check out [Bevy on I want Bevy to become a vibrant developer community ... thats actually why I chose the name! A Bevy is a group of birds, just like we are a group of game developers. Join the Bevy! - +The Bevy logo diff --git a/content/news/2020-08-19-scaling-bevy/index.md b/content/news/2020-08-19-scaling-bevy/index.md index 86ff4965fd..bec5baebd9 100644 --- a/content/news/2020-08-19-scaling-bevy/index.md +++ b/content/news/2020-08-19-scaling-bevy/index.md @@ -16,31 +16,31 @@ First, I want to take a moment to highlight just how wild the last week has been

3rd most popular /r/rust post of all time

- + The Introducing Bevy article at third place in Reddit's top rankings

#2 on Hacker News

- + The Introducing Bevy article at second place on Hacker News' top stories

2,200 Github Stars

- + A star with the word

26 contributors

- + A list of Bevy engine contributors profile pictures and the number 26

644 Discord Users

- + Text saying
diff --git a/content/news/2020-11-03-bevy-0.3/index.md b/content/news/2020-11-03-bevy-0.3/index.md index 7d21c7856e..d9279177e2 100644 --- a/content/news/2020-11-03-bevy-0.3/index.md +++ b/content/news/2020-11-03-bevy-0.3/index.md @@ -44,7 +44,7 @@ This was a massive group effort that spanned multiple projects: Bevy can now run on iOS! - +A beige cube on a green plane running on an iOS emulator You can try out the [Bevy iOS example](https://github.com/bevyengine/bevy/tree/v0.3.0/examples/ios) by following the [instructions here](https://github.com/bevyengine/bevy/tree/v0.3.0/examples#ios). This one is also hot off the presses: some features will work and others probably won't. diff --git a/content/news/2021-08-10-bevys-first-birthday/index.md b/content/news/2021-08-10-bevys-first-birthday/index.md index aaffda30e7..749a58d7ab 100644 --- a/content/news/2021-08-10-bevys-first-birthday/index.md +++ b/content/news/2021-08-10-bevys-first-birthday/index.md @@ -260,4 +260,4 @@ I'm looking forward to spending the next year with you all! \- [@cart](https://github.com/cart/) - +The Bevy logo diff --git a/content/news/2022-08-10-bevys-second-birthday/index.md b/content/news/2022-08-10-bevys-second-birthday/index.md index 808529849a..88262de5b0 100644 --- a/content/news/2022-08-10-bevys-second-birthday/index.md +++ b/content/news/2022-08-10-bevys-second-birthday/index.md @@ -211,4 +211,4 @@ This year is going to be a big one for Bevy. I'm looking forward to spending it \- [@cart](https://github.com/cart/) - +The Bevy logo diff --git a/content/news/2023-03-06-bevy-0.10/index.md b/content/news/2023-03-06-bevy-0.10/index.md index 674dd677ee..5ce66d1370 100644 --- a/content/news/2023-03-06-bevy-0.10/index.md +++ b/content/news/2023-03-06-bevy-0.10/index.md @@ -606,27 +606,27 @@ let's double the `emissive` value of each cube.
1
- + First image of bloom; from Bevy 0.9
2
- + Second image of bloom; from Bevy 0.9 with a tonemapper
3
- + Third image of bloom; from Bevy 0.10
4
- + Fourth image of bloom; from Bevy 0.10 with doubled emissive values
5
- + Fifth image of bloom; from Bevy 0.10 with additive compositing
6
- + The Bevy bloom 3D example
diff --git a/content/news/2023-08-10-bevys-third-birthday/index.md b/content/news/2023-08-10-bevys-third-birthday/index.md index e759ff6789..b3cd7ac919 100644 --- a/content/news/2023-08-10-bevys-third-birthday/index.md +++ b/content/news/2023-08-10-bevys-third-birthday/index.md @@ -231,4 +231,4 @@ I'm looking forward to spending another year building Bevy with you all! \- [@cart](https://github.com/cart/) - +The Bevy logo diff --git a/content/news/2023-09-21-community-reflection-on-bevys-third-year/index.md b/content/news/2023-09-21-community-reflection-on-bevys-third-year/index.md index 59c16b6fcb..81281c56b4 100644 --- a/content/news/2023-09-21-community-reflection-on-bevys-third-year/index.md +++ b/content/news/2023-09-21-community-reflection-on-bevys-third-year/index.md @@ -57,4 +57,4 @@ Here is to another year of Bevy! \- [@cart](https://github.com/cart/) - +The Bevy logo diff --git a/sass/_utils.scss b/sass/_utils.scss index b7e9acdfab..5f9393f3db 100644 --- a/sass/_utils.scss +++ b/sass/_utils.scss @@ -45,7 +45,7 @@ body:not(.show_drafts) .public_draft:not(.active_draft) { .anchor-link:link, .anchor-link:visited { margin-left: 0.3rem; - color: #737373; + color: $color-white; text-shadow: none; font-weight: 500; } diff --git a/sass/components/_docs-footer.scss b/sass/components/_docs-footer.scss index 9ce5d7d434..fb1b459102 100644 --- a/sass/components/_docs-footer.scss +++ b/sass/components/_docs-footer.scss @@ -73,7 +73,7 @@ &__dir { margin-bottom: 4px; - color: #666; + color: $secondary-text-color; text-transform: uppercase; font-size: 0.8rem; line-height: 1; diff --git a/sass/components/_syntax-theme.scss b/sass/components/_syntax-theme.scss index c3a64250c7..3314f5eb72 100644 --- a/sass/components/_syntax-theme.scss +++ b/sass/components/_syntax-theme.scss @@ -186,7 +186,7 @@ div.incorrect-image { .z-markup.z-deleted, .z-markup.z-deleted.z-git_gutter { - color: #bf616a; + color: #e0858d; } .z-markup.z-changed, @@ -223,7 +223,7 @@ div.incorrect-image { .z-invalid.z-illegal { color: #2b303b; - background-color: #bf616a; + background-color: #e0858d; } .z-markup.z-deleted.z-git_gutter { diff --git a/sass/pages/_migration_guide.scss b/sass/pages/_migration_guide.scss index c09820943f..4b335969e4 100644 --- a/sass/pages/_migration_guide.scss +++ b/sass/pages/_migration_guide.scss @@ -34,4 +34,5 @@ border-radius: 0.3rem; border-style: solid; border-width: 1px; + background-color: #17171a; } diff --git a/templates/assets.html b/templates/assets.html index 838c0e84ec..1c10f10f8c 100644 --- a/templates/assets.html +++ b/templates/assets.html @@ -10,10 +10,11 @@ + placeholder="Search (ie: 0.11 MIT)" + aria-label="Search (ie: 0.11 MIT)" />
- + diff --git a/templates/examples-webgpu.html b/templates/examples-webgpu.html index e964e14633..bbe3c1fa44 100644 --- a/templates/examples-webgpu.html +++ b/templates/examples-webgpu.html @@ -18,7 +18,8 @@

Support Warning

+ placeholder="Search Example" + aria-label="Search Example" />
{% for subsection in section.subsections %} {% set section = get_section(path=subsection) %} diff --git a/templates/examples.html b/templates/examples.html index c9fd891742..c14dd6bcff 100644 --- a/templates/examples.html +++ b/templates/examples.html @@ -19,7 +19,8 @@ + placeholder="Search Example" + aria-label="Search Example" /> {% for subsection in section.subsections %} {% set section = get_section(path=subsection) %}