Skip to content

Merge Global Data Files with addGlobalData? #1826

Answered by pdehaan
debatz asked this question in Q&A
Discussion options

You must be logged in to vote

I haven't tried global data files yet, but note from the docs that it is Coming soon in v1.0.0 (and the current stable release from npm is still v0.12.1). So information and details from Google is probably pretty rare currently, and it'd only be available if you install Eleventy directly from GitHub, or a canary release from npm.

I imagine you'd be able to merge some stuff from global data files by requiring the files in your .eleventy.js config and then use .addGlobalData(), but I'm not sure you'd have access to stuff like collections.

You could probably create a global data file in the current v0.12 that makes multiple API calls in a single file and return a value without needing to wri…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@pdehaan
Comment options

pdehaan Jun 11, 2021
Collaborator

@debatz
Comment options

Answer selected by debatz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants