diff --git a/components/site/test_site/templates/category.html b/components/site/test_site/templates/category.html index 842f6e2d..f7904310 100644 --- a/components/site/test_site/templates/category.html +++ b/components/site/test_site/templates/category.html @@ -1,8 +1,5 @@ -Category: {{ category.name }} +{% extends "sample/templates/category.html" %} - -{% for page in category.pages %} -
-

{{ page.title }}

-
-{% endfor %} +{% block extra_category %} +EXTENDED +{% endblock extra_category %} diff --git a/components/site/test_site/themes/sample/templates/category.html b/components/site/test_site/themes/sample/templates/category.html new file mode 100644 index 00000000..7a016ae2 --- /dev/null +++ b/components/site/test_site/themes/sample/templates/category.html @@ -0,0 +1,11 @@ +Category: {{ category.name }} + + +{% for page in category.pages %} +
+

{{ page.title }}

+
+{% endfor %} + +{% block extra_category %} +{% endblock extra_category %} diff --git a/components/site/tests/site.rs b/components/site/tests/site.rs index bf1d4e26..659304b3 100644 --- a/components/site/tests/site.rs +++ b/components/site/tests/site.rs @@ -223,6 +223,8 @@ fn can_build_site_with_categories() { assert!(file_exists!(public, "categories/index.html")); assert!(file_exists!(public, "categories/a/index.html")); assert!(file_exists!(public, "categories/b/index.html")); + // Extending from a theme works + assert!(file_contains!(public, "categories/a/index.html", "EXTENDED")); // Tags aren't assert_eq!(file_exists!(public, "tags/index.html"), false);