Open N7K4 opened 3 years ago
Interesting Idea. What would go in the group index file? DataPage correlates one page per record, nested or not. To 'wrap' up the collection into a hub page, like you did, you could make another record with a 'permalink' prop.
- name: cata
perma: /products # /:collection/ if collections enabled
OR
Add plugin option from group_index: true
and have it output something like:
---
permalink: /{{ site.page_gen[0].dir }}/
title: /:name/
---
{% for item in site.data.[{{ collection.name }}] %}
<li>
<a href="{{ item.name | datapage_url: '-' }}">{{ cat.name}}</a>
</li>
{% endfor %}
Personally, I'd just use another data_entry and add a permalink variable to it's template file.
I like this plugin, it saved me a lot of time! Many thanks.
But I reconginzed one issue. The data generator created only the index.html for the subfolders, not also for the group folder.
My config file
_config.yml
.My reduced data file
product_categories.json
.Will generate the following structure under
_site
.But when the user navigate to
https://blog.domain.tld/products/
there is nothing (404 HTML error). Because there is no index.html on group folder, or no redirect to an other page.Would it be possible to generate also the index.html on the group folder
products
in my case? So that would be the output?MY WORKAROUND
Create a file
products.md
in thepages
folder.This will generate a
index.html
under_site/products
.