timwis / jkan

A lightweight, backend-free open data portal, powered by Jekyll
https://jkan.io
MIT License
219 stars 309 forks source link

Add Netlify CMS preview templates #206

Open timwis opened 1 year ago

timwis commented 1 year ago

The default preview template in Netlify CMS just shows each field. It's not bad, but of course it would be nice if the preview resembled the page that JKAN will generate.

Screenshot 2022-11-16 at 08 17 10

Netlify CMS supports custom preview templates. They have to be React components, which is a bit annoying, but I don't expect it will be much effort, particularly since we can plug in the field renderers that Netlify CMS ships with (e.g. string renderer, boolean renderer, etc.).

It would be great if we could somehow pull in the actual dataset template in _layouts/dataset.html, though I expect if that's possible, it will be pretty hacky.