Skip to content

Unable to use custom base file name for data files unless 11tydata also included as extension #2872

Open
@paulrobertlloyd

Description

@paulrobertlloyd

Operating system

macOS Ventura 13.2.1

Eleventy

2.0.0

Describe the bug

I’m trying to use a custom base file name so that I can use the following directory data files1:

.
├── articles
│   ├── 2023-03-18-example.md
│   └── _data.json
└── notes
    ├── 2023-03-18-1.md
    └── _data.json

However, the custom base file name only appears to work if the .11tydata suffix is provided:

Using default config (data files share same name as directory):

  • [directory_name].11tydata.json
  • [directory_name].json

Using eleventyConfig.setDataFileBaseName("_data"):

  • _data.11tydata.json
  • _data.json

Setting eleventyConfig.setDataFileSuffixes([""]) has no effect, either.

Footnotes

  1. I actually want to use a custom data format, YAML, so that I can use _data.yaml files, but given the natively supported JSON format doesn’t work as expected either, using this as my example.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions