mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 02:10:41 -07:00
Merge pull request #1123 from ZakCodes/collections
Use collections for the sections of the site
This commit is contained in:
+9
-8
@@ -16,6 +16,15 @@ exclude:
|
|||||||
- node_modules
|
- node_modules
|
||||||
keep_files: ["css"]
|
keep_files: ["css"]
|
||||||
|
|
||||||
|
# Collections
|
||||||
|
collections:
|
||||||
|
basics:
|
||||||
|
output: true
|
||||||
|
tags:
|
||||||
|
output: true
|
||||||
|
filters:
|
||||||
|
output: true
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
plugins:
|
plugins:
|
||||||
- jekyll-redirect-from
|
- jekyll-redirect-from
|
||||||
@@ -26,11 +35,3 @@ defaults:
|
|||||||
path: "" # an empty string here means all files in the project
|
path: "" # an empty string here means all files in the project
|
||||||
values:
|
values:
|
||||||
layout: default
|
layout: default
|
||||||
- scope:
|
|
||||||
path: "filters"
|
|
||||||
values:
|
|
||||||
type: filter
|
|
||||||
- scope:
|
|
||||||
path: "tags"
|
|
||||||
values:
|
|
||||||
type: tag
|
|
||||||
|
|||||||
@@ -15,14 +15,10 @@
|
|||||||
<h3 class="section__header">{{ section | capitalize }}</h3>
|
<h3 class="section__header">{{ section | capitalize }}</h3>
|
||||||
|
|
||||||
<ul class="section__links">
|
<ul class="section__links">
|
||||||
{%- for item in site.pages -%}
|
{%- for item in site[section] -%}
|
||||||
{%- if item.url contains section/ -%}
|
<li class="section__item">
|
||||||
{%- unless item.path contains "index" -%}
|
<a href="{{ item.url | relative_url }}" class="section__link{% if item.url == page.url %} section__link--is-active{% endif %}">{{ item.title }}</a>
|
||||||
<li class="section__item">
|
</li>
|
||||||
<a href="{{ item.url | relative_url }}" class="section__link {% if item.url contains page.url and page.url != '/' and page.type != 'index' %} section__link--is-active{% endif %}">{{ item.title }}</a>
|
|
||||||
</li>
|
|
||||||
{%- endunless -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</ul>
|
</ul>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|||||||
Reference in New Issue
Block a user