Can't access site.data variable
See original GitHub issueHello I have menu.json file in _data folder:
[
{"url":"","index":"0"},
{"url":"about","index":"1"},
{"url":"portfolio","index":"2"},
{"url":"expertise","index":"3"},
{"url":"contact","index":"4"}
]
I’m trying to log site.data.menu from main.js:
console.log(site.data.menu)
And have this error:
Can someone help me with this please ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Can't access Site variables inside nested partial - HUGO
Hi ! I got an issue recently and I can't resolve it on my own. It might be really simple to solve it...
Read more >vue.js - Can't access data variable inside watcher, inside .map()
I have defined types and history variables inside data and in watch, I am trying to access another variable rather than the one...
Read more >ReferenceError: can't access lexical declaration 'X' before ...
A lexical variable was accessed before it was initialized. This happens within any block statement, when variables declared with let or const ...
Read more >Can't access `ELEVENTY_ENV` data · Issue #1886 - GitHub
I'm trying to set the ELEVENTY_ENV in my site data file, following the Exposing environment variables it's not returning anything.
Read more >Frequently Asked Questions (FAQ) - IPUMS International
Why can't I open the data file? ... These links open the variables page: the primary tool for exploring the contents of IPUMS-International....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you want use files from _data folder in your .js files, you can achieve it with:
Works like a charm !
You’re welcome @driera