Skip to content

Instantly share code, notes, and snippets.

@hughbris
Last active December 1, 2016 05:11
Show Gist options
  • Save hughbris/a1be0f7f98dbafed49ae935f4f6fb7c5 to your computer and use it in GitHub Desktop.
Save hughbris/a1be0f7f98dbafed49ae935f4f6fb7c5 to your computer and use it in GitHub Desktop.
Patch of user directory from Grav 1.1.8 to reproduce issue #1184
diff --git a/config/site.yaml b/config/site.yaml
index c45818d..0b0c82a 100644
--- a/config/site.yaml
+++ b/config/site.yaml
@@ -2,6 +2,9 @@ title: Grav
author:
name: Joe Bloggs
email: 'joe@test.com'
+taxonomies:
+ - tag
+ - team
metadata:
description: 'Grav is an easy to use, yet powerful, open source flat-file CMS'
diff --git a/pages/02.staff/01.unhygienic-person/staff-profile.md b/pages/02.staff/01.unhygienic-person/staff-profile.md
new file mode 100644
index 0000000..009fef5
--- /dev/null
+++ b/pages/02.staff/01.unhygienic-person/staff-profile.md
@@ -0,0 +1,17 @@
+---
+title: Unhygienic Person
+visible: false
+taxonomy:
+ tag: staff
+ team: unwashed
+---
+
+I started refusing to wash in 1988.
+
+Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
+
+Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.
+
+Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.
+
+Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
diff --git a/pages/02.staff/_hygienists/staff-group.md b/pages/02.staff/_hygienists/staff-group.md
new file mode 100644
index 0000000..ba9b542
--- /dev/null
+++ b/pages/02.staff/_hygienists/staff-group.md
@@ -0,0 +1,18 @@
+---
+title: Hygienists
+id: hygienists
+content:
+ items:
+ '@taxonomy': {tag: staff, team: hygienists}
+ order:
+ by: default
+ dir: asc
+
+---
+<!-- https://github.com/getgrav/grav/issues/1184 -->
+
+___
+
+### Hygienists listing
+
+Shouldn't be showing anyone because there are no hygienists.
diff --git a/pages/02.staff/_unwashed/staff-group.md b/pages/02.staff/_unwashed/staff-group.md
new file mode 100644
index 0000000..ee4b688
--- /dev/null
+++ b/pages/02.staff/_unwashed/staff-group.md
@@ -0,0 +1,16 @@
+---
+title: The Unwashed
+id: unwashed
+content:
+ items:
+ '@taxonomy': {tag: staff, team: unwashed}
+ order:
+ by: default
+ dir: asc
+
+---
+___
+
+### Unwashed among us
+
+At least we're housetrained.
diff --git a/pages/02.staff/staff.md b/pages/02.staff/staff.md
new file mode 100644
index 0000000..b52a302
--- /dev/null
+++ b/pages/02.staff/staff.md
@@ -0,0 +1,17 @@
+---
+title: Our Staff
+supporting: false
+
+content:
+ items: '@self.modular'
+ order:
+ by: default
+ dir: asc
+ custom:
+ - _unwashed
+ - _hygienists
+---
+
+This shows a listing of modular pages in groups, each of which displays snippets from relevant collections selected by 'tag' and 'team' vocabulary terms.
+
+Context: ___[Collection filter based on more than one taxonomy discards criteria where terms are not in the taxonomy](https://github.com/getgrav/grav/issues/1184)___
diff --git a/themes/antimatter/templates/modular/staff-group.html.twig b/themes/antimatter/templates/modular/staff-group.html.twig
new file mode 100644
index 0000000..7f28728
--- /dev/null
+++ b/themes/antimatter/templates/modular/staff-group.html.twig
@@ -0,0 +1,18 @@
+<div id="{{ page.header.id }}">
+
+ {# dump(page.collection) #}
+
+ {{ content }}
+
+ <ul class="teasers profiles">
+ {% for p in page.collection %}
+ <li id="{{p.slug()}}" class="pure-g">
+ <div class="pure-u-4-5">
+ <h4 class="meta"><a href="{{p.url()}}">{{p.title}}</a></h4>
+ <p class="meta snippet">{{ p.content|striptags|truncate(100,true,'.') }} <a href="{{p.url()}}" title="More about {{p.title}}">..</a></p>
+ </div>
+ </li>
+ {% endfor %}
+ </ul>
+
+</div>
diff --git a/themes/antimatter/templates/staff-profile.html.twig b/themes/antimatter/templates/staff-profile.html.twig
new file mode 100644
index 0000000..68c1a00
--- /dev/null
+++ b/themes/antimatter/templates/staff-profile.html.twig
@@ -0,0 +1,23 @@
+{% embed 'partials/base.html.twig' %}
+
+ {% block content %}
+ <div class="content-wrapper grid pure-g">
+
+ <div id="main" class="profile block pure-u-1-2">
+ <h3>{{ page.title }}</h3>
+ <div class="meta tags">
+ {% for vocab,terms in page.taxonomy %}
+ <strong>{{ vocab }}:</strong>
+ {% for term in terms %}
+ <a href="search/tag:{{ term }}">{{ term }}</a>
+ {% endfor %}
+ {% endfor %}
+ </div>
+ <div class="meta bio">
+ {{ page.content }}
+ </div>
+ </div>
+ </div>
+ {% endblock %}
+
+{% endembed %}
diff --git a/themes/antimatter/templates/staff.html.twig b/themes/antimatter/templates/staff.html.twig
new file mode 100644
index 0000000..cb11158
--- /dev/null
+++ b/themes/antimatter/templates/staff.html.twig
@@ -0,0 +1,23 @@
+{% embed 'partials/base.html.twig' %}
+
+ {% block content %}
+ <div class="content-wrapper grid pure-g">
+
+ <div id="main" class="block pure-u-3-4">
+ {{ page.content }}
+
+ <div id="tabs">
+ <ul>
+ {% for module in page.collection() %}
+ <li><a href="#{{ module.header.id }}">{{ module.title }}</a></li>
+ {% endfor %}
+ </ul>
+ {% for module in page.collection() %}
+ {{ module.content }}
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+ {% endblock %}
+
+{% endembed %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment