Skip to content

Is there a way to convert string to a type variable #3041

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

You must be logged in to vote

I've found it easiest to nest your global data files in a subdirectory.
For example: ./src/_data/users/foo.json

Then you should be able to do something like this:

---
test: foo
---

{{ users[test].name }}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tushargugnani
Comment options

Answer selected by tushargugnani
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