Skip to content

Commit 3a9170f

Browse files
committed
list-of-extensions: limit to pages with categories
1 parent 8abc305 commit 3a9170f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

_pages/list-of-extensions.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ section: Extend
77
---
88
{%- assign category-string = "" -%}
99
{%- for p in site.pages -%}
10-
{%- assign tokens = p.url | split: "/" -%}
11-
{%- if tokens[3] and tokens[3] != 'index' -%} {%- continue -%} {%- endif -%}
1210
{%- comment -%}
1311
It would be nicer to use the concat filter below, no?
1412
But that filter only became available in Jekyll 4.0.
@@ -121,10 +119,8 @@ function toggleAllCategories(checked) {
121119

122120
<ul id="list-of-extensions">
123121
{%- for p in site.pages -%}
124-
{%- assign tokens = p.url | split: "/" -%}
125-
{%- if tokens[1] != 'plugins' and tokens[1] != 'formats' -%} {%- continue -%} {%- endif -%}
126-
{%- if tokens[3] and tokens[3] != 'index' -%} {%- continue -%} {%- endif -%}
127-
{%- assign url = p.url | replace: '/index', '' -%}
122+
{%- comment -%} Only pages declaring categories are listed. {%- endcomment -%}
123+
{%- unless p.categories -%} {%- continue -%} {%- endunless -%}
128124
{%- assign classes = "" -%}
129125
{%- for category in p.categories -%}
130126
{%- assign c = category | slugify -%}

0 commit comments

Comments
 (0)