So I was pretty excited about the new custom output stuff in 0.20, but maybe I got too excited too quickly.
I thought this update would simplify creating dynamic pages in non-HTML format. So for example. I want /foo.json to to be a JSON array of the last 5 pages created.
I thought I could go into /content, make a new file, foo.json, and include Go language inside. I did that, but the template stuff isnāt being parsed. I even added front matter, but it didnāt work.
Yep, I did read the docs. It doesnāt seem to explain how one would create a file w/ custom logic (again, using the Go syntax) to spit out something thatās not HTML. Is it indeed possible?
Alright - so given /content/foo.json, can you confirm that I need front matter in order for it to be parsed and just not copied over? Could you maybe show a simple example of just outputting one variable in the JSON?
Can you point to where in the documentation is says that you should put a JSON file or similar inside /content? That would be good to fix, as that would create confusion.
As to examples, if you need anymore than whatās provided, you will have to wait for others to chime in.
Maybe Iām just confused then. My read on this new feature was that I could create a template that was dynamic (locally of course) that would be built static and would allow for things like a custom JSON file, or some such.
Is that not true? If so, then how is it done? Iām not asking for a large demo, even something as simple as:
{ āsiteNameā: āthis would be dynamic based on site nameā}
That should be a trivial example, right? (Assuming Iām reading the docs right.)