Add test for extending theme template
This commit is contained in:
parent
edc3fd2295
commit
e1ee6b9dc4
|
@ -1,8 +1,5 @@
|
||||||
Category: {{ category.name }}
|
{% extends "sample/templates/category.html" %}
|
||||||
|
|
||||||
|
{% block extra_category %}
|
||||||
{% for page in category.pages %}
|
EXTENDED
|
||||||
<article>
|
{% endblock extra_category %}
|
||||||
<h3 class="post__title"><a href="{{ page.permalink }}">{{ page.title }}</a></h3>
|
|
||||||
</article>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
Category: {{ category.name }}
|
||||||
|
|
||||||
|
|
||||||
|
{% for page in category.pages %}
|
||||||
|
<article>
|
||||||
|
<h3 class="post__title"><a href="{{ page.permalink }}">{{ page.title }}</a></h3>
|
||||||
|
</article>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% block extra_category %}
|
||||||
|
{% endblock extra_category %}
|
|
@ -223,6 +223,8 @@ fn can_build_site_with_categories() {
|
||||||
assert!(file_exists!(public, "categories/index.html"));
|
assert!(file_exists!(public, "categories/index.html"));
|
||||||
assert!(file_exists!(public, "categories/a/index.html"));
|
assert!(file_exists!(public, "categories/a/index.html"));
|
||||||
assert!(file_exists!(public, "categories/b/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
|
// Tags aren't
|
||||||
assert_eq!(file_exists!(public, "tags/index.html"), false);
|
assert_eq!(file_exists!(public, "tags/index.html"), false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue