Middleman automatically loads the contents of .json or .yml data files that exist in the /data folder.
Is there any way to load the contents of any .txt or .md file inside this folder?
I found this extension, but I don't see how I can achieve that.
Example
Given this structure and the following files:
data/
├── foo.yml
└── bar.txt
foo.yml:
text: "I can load this text."
bar.txt
I want to load this text.
I can access data.foo.text and retrieve I can load this text.
I want to access data.bar and retrieve I want to load this text.
i'm not sure what you're trying to achieve by reading the txt data (or markdown). middleman data is not intended to contain data other than array/hash form. assuming you want to load long (or formatted) text, this is better way IMO
posts.yml:
and in your view: