betty icon indicating copy to clipboard operation
betty copied to clipboard

Split generation out per content type

Open bartfeenstra opened this issue 4 years ago • 1 comments

Move generation to plugins, and let plugins expose generators. A genrator can output public data and ahould then define a content define the formats (content types, etc) they can generate. By default we ship with a plugin that generates text/html, but we can later add others, such as application/ld+json , or even one for nginx configuration.

bartfeenstra avatar Jul 15 '19 18:07 bartfeenstra

Alternatively we can take a file-based approach. This means that for every resource type we want to render, there's a directory in the file system with templates. For each resource, these are copied to the resource's destination directory, and then rendered. The advantages are that the generation API does not need to know which files are being rendered: it just provides the source directory path, destination directory path, and template variables. The renderers will do the rest. Plugins and individual site configurations can then override or add files.

bartfeenstra avatar Mar 30 '20 01:03 bartfeenstra