From c49330ed36e84e82565fdac4aff17425a482d947 Mon Sep 17 00:00:00 2001 From: Sigma-dev Date: Sat, 29 Nov 2025 22:19:51 +0100 Subject: [PATCH 1/2] Add banner to warn user of required feature flags for examples --- templates/layouts/example.html | 212 +++++++++++++++++---------------- 1 file changed, 112 insertions(+), 100 deletions(-) diff --git a/templates/layouts/example.html b/templates/layouts/example.html index 2c1ac59f2e..9af74d574c 100644 --- a/templates/layouts/example.html +++ b/templates/layouts/example.html @@ -1,66 +1,78 @@ {% extends "layouts/base.html" %} {% block content %} -
-
- {% set total_ancestors = page.ancestors | length %} - {% set parent_idx = total_ancestors - 1 %} - {% set category = get_section(path=page.ancestors | nth(n=parent_idx)) %} -

{{ category.title }} / {{ page.title }}

+
+
+ {% set total_ancestors = page.ancestors | length %} + {% set parent_idx = total_ancestors - 1 %} + {% set category = get_section(path=page.ancestors | nth(n=parent_idx)) %} +

{{ category.title }} / {{ page.title }}

Back to examples - View in GitHub - -
-
- -
-
-
-
-
-
- -
+
+
- {% if page.content %} -
- {{ page.content | safe }} + +
+
+
+
+
+ + + {% if page.extra.required_features %} + {% endif %} -
- {% set filename = page.extra.code_path | split(pat="/") | last %} - - -
-
- {% set code = load_data(path=page.extra.code_path) %} - {% set code_md = "```rust" ~ newline ~ code ~ "```" %} - {{ code_md | markdown(inline=true) | safe }} -
+
+ {% if page.content %} +
+ {{ page.content | safe }} +
+ {% endif %} +
+ {% set filename = page.extra.code_path | split(pat="/") | last %} + + +
+
+ {% set code = load_data(path=page.extra.code_path) %} + {% set code_md = "```rust" ~ newline ~ code ~ "```" %} + {{ code_md | markdown(inline=true) | safe }} +
+
+ + {% for shader in page.extra.shader_code_paths %} + + +
+
+ {% set code = load_data(path="static/assets/examples/" ~ shader) %} + {% set code_md = "```wgsl" ~ newline ~ code ~ "```" %} + {{ code_md | markdown(inline=true) | safe }}
- - {% for shader in page.extra.shader_code_paths %} - - -
-
- {% set code = load_data(path="static/assets/examples/" ~ shader) %} - {% set code_md = "```wgsl" ~ newline ~ code ~ "```" %} - {{ code_md | markdown(inline=true) | safe }} -
-
- {% endfor %}
+ {% endfor %}
- + init().catch((error) => { + if (!error.message.startsWith("Using exceptions for control flow, don't mind me. This isn't actually an error!")) { + throw error; + } + }); + {% endblock content %} From a0b2222b5af2f49e547cc47061deeccd244f6d01 Mon Sep 17 00:00:00 2001 From: Sigma-dev Date: Thu, 4 Dec 2025 19:51:05 +0100 Subject: [PATCH 2/2] Changed feature flag banner header to be more descriptive --- templates/layouts/example.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/layouts/example.html b/templates/layouts/example.html index 9af74d574c..a3f412ef82 100644 --- a/templates/layouts/example.html +++ b/templates/layouts/example.html @@ -30,7 +30,7 @@

{{ category.title }} / {{ page.title }}

{% if page.extra.required_features %}