mmistakes / minimal-mistakes

:triangular_ruler: Jekyll theme for building a personal site, blog, project documentation, or portfolio.
https://mmistakes.github.io/minimal-mistakes/
MIT License
12.42k stars 25.58k forks source link

a collection can't work in a custom folder. #1580

Closed xinfengwu closed 6 years ago

xinfengwu commented 6 years ago

Environment informations


Expected behavior

The to-list-collectionTest.mdis expected to show the list of collectionTestBut it doesn't work. How is this not working?

Steps to reproduce the behavior

_config.yml

collections:
   collectionTest:
      output: true
      permalink:  /:collection/:path/
  ...
defaults:
  # _collectionTest
     - scope:
        path: ""
        type: collectionTest
      values:
        layout: single
        author_profile: true
        share: false

Directory Structure:

├── ...
├── _pages
│   ├── to-list-collectionTest.md
├── myfolder
│   ├── _collectionTest
│   │   ├── 00-samplefile.md

to-list-collectionTest.md:

---
layout: archive
title: "CollectionTest-List"
permalink: /listcolletion/
author_profile: true
---
This is a page to list collection.

<ul>
  {% for item in site.collectionTest %}
  <ul>
    <a href="{{ item.url | prepend: item.baseurl }}">{{ item.title }}</a>
  </ul>

00-samplefile.md

---
tiltle: showme
---
mmistakes commented 6 years ago

Have you tried moving the _collectionTest to the root instead of in myfolder? Don't think they work when in other folders as you have.

Either way this isn't a theme issue. If you need help with collections it is best to ask on the Jekyll Talk forum or file a issue on their repo.

xinfengwu commented 6 years ago

Thank you for your time! @mmistakes

mmistakes commented 6 years ago

Looks like collections can be grouped in folders but it's a 3.7.0 feature. And GitHub Pages hasn't updated to that version yet so that could be your issue.

mmistakes commented 6 years ago

Related: https://github.com/jekyll/jekyll/issues/6656