diff --git a/hyde/tests/ext/test_grouper.py b/hyde/tests/ext/test_grouper.py
index 72dbf1a..5aeba0a 100644
--- a/hyde/tests/ext/test_grouper.py
+++ b/hyde/tests/ext/test_grouper.py
@@ -50,7 +50,6 @@ class TestGrouperSingleLevel(object):
name: plugins
description: Plugins
-
"""
self.s.config = Config(TEST_SITE, config_dict=yaml.load(cfg))
self.s.load()
@@ -176,6 +175,7 @@ class TestGrouperSingleLevel(object):
index += 1
def test_nav_with_grouper(self):
+
text ="""
{% for group, resources in site.content.walk_section_groups() %}
@@ -224,6 +224,99 @@ class TestGrouperSingleLevel(object):
"""
+ gen = Generator(self.s)
+ gen.load_site_if_needed()
+ gen.load_template_if_needed()
+ out = gen.template.render(text, {'site':self.s})
+ assert_html_equals(out, expected)
+
+ def test_nav_with_grouper_sorted(self):
+
+ cfg = """
+ nodemeta: meta.yaml
+ plugins:
+ - hyde.ext.plugins.meta.MetaPlugin
+ - hyde.ext.plugins.sorter.SorterPlugin
+ - hyde.ext.plugins.grouper.GrouperPlugin
+ sorter:
+ kind:
+ attr:
+ - source_file.kind
+ filters:
+ is_processable: True
+ grouper:
+ section:
+ description: Sections in the site
+ sorter: kind
+ groups:
+ -
+ name: start
+ description: Getting Started
+ -
+ name: awesome
+ description: Awesome
+ -
+ name: plugins
+ description: Plugins
+
+ """
+ self.s.config = Config(TEST_SITE, config_dict=yaml.load(cfg))
+ self.s.load()
+ MetaPlugin(self.s).begin_site()
+ SorterPlugin(self.s).begin_site()
+ GrouperPlugin(self.s).begin_site()
+
+ text ="""
+{% set sorted = site.grouper['section'].groups|sort(attribute='name') %}
+{% for group in sorted %}
+
+ -
+
{{ group.name|title }}
+ {{ group.description }}
+
+ {% for resource in group.walk_resources_in_node(site.content) %}
+ - {{resource.name}}
+ {% endfor %}
+
+
+
+{% endfor %}
+
+"""
+ expected = """
+
+ -
+
Awesome
+ Awesome
+
+
+
+
+ -
+
Plugins
+ Plugins
+
+ - plugins.html
+ - tags.html
+
+
+
+
+ -
+
Start
+ Getting Started
+
+ - installation.html
+ - overview.html
+ - templating.html
+
+
+
+
+
+"""
+ self.s.config.grouper.section.groups.append(Expando({"name": "awesome", "description": "Aweesoome"}));
gen = Generator(self.s)
gen.load_site_if_needed()
gen.load_template_if_needed()
diff --git a/hyde/tests/test_plugin.py b/hyde/tests/test_plugin.py
index 93561d3..042d0d7 100644
--- a/hyde/tests/test_plugin.py
+++ b/hyde/tests/test_plugin.py
@@ -328,4 +328,4 @@ class TestPlugins(object):
gen.generate_resource_at_path(path)
about = File(Folder(
self.site.config.deploy_root_path).child('about.html'))
- assert about.read_all() == "Jam"
+ assert about.read_all() == "Jam"
\ No newline at end of file