Skip to content

How to fetch from all child folders? #129

@jackdomleo7

Description

@jackdomleo7

I have this directory structure:

- content/
  - articles/
    - 2020/
    - 2019/
    - 2018/
  - projects/

I want to be able to fetch every .md file from the content/articles/ directory.

I have tried the following:

this.articles = await this.$content('articles/**/*').fetch();
this.articles = await this.$content('articles/*').fetch();
this.articles = await this.$content('articles/').fetch();
this.articles = await this.$content('articles').fetch();

Any ideas how I can achieve this?

Extra info:
My first step was to place all articles inside the articles directory and fetch them from there, and it worked perfectly. I'm now looking to further split my articles into year directories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions