Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/test_site/pages/sitemap.tmpl

Issue 29472555: Issue 4867 - Add global get_pages_metadata to template converters (Closed)
Patch Set: Created June 23, 2017, 9:54 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« tests/test_page_outputs.py ('K') | « tests/test_site/pages/global.tmpl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_site/pages/sitemap.tmpl
===================================================================
new file mode 100644
--- /dev/null
+++ b/tests/test_site/pages/sitemap.tmpl
@@ -0,0 +1,24 @@
+template = empty
+product = foo
+title = test_metadata
+tags = [popular, bar]
+<h1> Unfiltered </h1>
+<ul>
+ {%- for unfiltered_page in get_pages_metadata() -%}
+ <li>title : {{ unfiltered_page['page']}} </li>
+{%- endfor %}
+</ul>
+
+<h1> Filtered </h1>
+<ul>
+ {%- for filtered_page in get_pages_metadata({'tags': ['popular', 'bar']}) -%}
+ <li>title : {{ filtered_page['page'] }} </li>
+{%- endfor %}
+</ul>
+
+<h1> String Filter For Listy Option </h1>
+<ul>
+ {%- for filtered_page in get_pages_metadata({'tags': 'popular'}) -%}
+ <li>title : {{ filtered_page['page'] }} </li>
+{%- endfor %}
+</ul>
« tests/test_page_outputs.py ('K') | « tests/test_site/pages/global.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld