Skip to content

Calling getCollection from a preview template should expose the slugs #7435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fgnass opened this issue Mar 24, 2025 · 0 comments
Open

Calling getCollection from a preview template should expose the slugs #7435

fgnass opened this issue Mar 24, 2025 · 0 comments
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@fgnass
Copy link
Contributor

fgnass commented Mar 24, 2025

Currently, when calling getCollection() inside a preview template, only the data of the items is returned. In order to be useful, the returned Map should also include the path & slug.

Since the function already returns a Map (with just a single data key), adding path and slug is trivial and would be a non-breaking change.

I'll submit a PR for this.

@fgnass fgnass added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

1 participant