diff --git a/_layouts/collection/collection_refpage.html b/_layouts/collection/collection_refpage.html
new file mode 100644
index 00000000..c0ab7fed
--- /dev/null
+++ b/_layouts/collection/collection_refpage.html
@@ -0,0 +1,42 @@
+---
+layout: content
+---
+
+{% assign all_items = "" | split: "/" %}
+{% for col_item in site[page.collection] %}
+ {% for item in col_item[page.reference] %}
+ {% assign preprocessed = item | strip %}
+ {% unless preprocessed == "" %}
+ {% assign all_items = all_items | push: preprocessed %}
+ {% endunless %}
+ {% endfor %}
+{% endfor %}
+{% assign all_items = all_items | uniq | sort %}
+
+
+{% for item in all_items %}
+ {% unless tag == "" %}
+
+ {{ item }}
+
+ {% endunless %}
+{% endfor %}
+
+{% for item in all_items %}
+ {% unless item == "" %}
+
{{ item }}
+
+
+ {% for plugin in site[page.collection] %}
+ {% assign col_items = "" | split: "/" %}
+ {% for item in plugin[page.reference] %}
+ {% assign lower_item = item %}
+ {% assign col_items = col_items | push: lower_item %}
+ {% endfor %}
+ {% if col_items contains item %}
+ {% include plugin_card.html plugin=plugin %}
+ {% endif %}
+ {% endfor %}
+
+ {% endunless %}
+{% endfor %}
\ No newline at end of file
diff --git a/categories.html b/categories.html
index c8cd1a77..342ba09b 100644
--- a/categories.html
+++ b/categories.html
@@ -1,42 +1,7 @@
---
+layout: collection/collection_refpage
title: Plugins by Category
+collection: repo
+permalink: /categories/
+reference: categories
---
-
-{% assign all_cats = "" | split: "/" %}
-{% for plugin in site.repo %}
- {% for cat in plugin.categories %}
- {% assign preprocessed = cat | strip | downcase %}
- {% unless preprocessed == "" %}
- {% assign all_cats = all_cats | push: preprocessed %}
- {% endunless %}
- {% endfor %}
-{% endfor %}
-{% assign all_cats = all_cats | uniq | sort %}
-
-
-{% for cat in all_cats %}
- {% unless tag == "" %}
-
- {{ cat }}
-
- {% endunless %}
-{% endfor %}
-
-{% for cat in all_cats %}
-{% unless cat == "" %}
-{{ cat }}
-
-
- {% for plugin in site.repo %}
- {% assign plugin_cats = "" | split: "/" %}
- {% for cat in plugin.categories %}
- {% assign lower_cat = cat | downcase %}
- {% assign plugin_cats = plugin_cats | push: lower_cat %}
- {% endfor %}
- {% if plugin_cats contains cat %}
- {% include plugin_card.html plugin=plugin %}
- {% endif %}
- {% endfor %}
-
-{% endunless %}
-{% endfor %}
\ No newline at end of file
diff --git a/tags.html b/tags.html
index 842eff38..6d4e13a6 100644
--- a/tags.html
+++ b/tags.html
@@ -1,42 +1,7 @@
---
+layout: collection/collection_refpage
title: Plugins by Tags
+collection: repo
+permalink: /tags/
+reference: tags
---
-
-{% assign all_tags = "" | split: "/" %}
-{% for plugin in site.repo %}
- {% for tag in plugin.tags %}
- {% assign preprocessed = tag | strip | downcase %}
- {% unless preprocessed == "" %}
- {% assign all_tags = all_tags | push: preprocessed %}
- {% endunless %}
- {% endfor %}
-{% endfor %}
-{% assign all_tags = all_tags | uniq | sort %}
-
-
-{% for tag in all_tags %}
- {% unless tag == "" %}
-
- {{ tag }}
-
- {% endunless %}
-{% endfor %}
-
-{% for tag in all_tags %}
-{% unless tag == "" %}
-{{ tag }}
-
-
- {% for plugin in site.repo %}
- {% assign plugin_tags = "" | split: "/" %}
- {% for tag in plugin.tags %}
- {% assign lower_tag = tag | downcase %}
- {% assign plugin_tags = plugin_tags | push: lower_tag %}
- {% endfor %}
- {% if plugin_tags contains tag %}
- {% include plugin_card.html plugin=plugin %}
- {% endif %}
- {% endfor %}
-
-{% endunless %}
-{% endfor %}
\ No newline at end of file