Research ways for creating meta info about a static generated site's source
Problem
To enable the editing of static sites in production we will need to understand the relationship between a generated page and its source.
Objective
Identify the different mechanisms we can use, and validate them with a POC, to get the associated information we might need.
Requirements
- We need to know the link between a generated page and its source file
- We need to know the line number in the source file that corresponds to the generated output.
We'll need to do this across multiple static site generators, but to start with we'll just focus on Middleman.
Ideas
Here are a few ideas to explore:
- Generate a site-meta.json file during build that gets deployed with the site that holds all the necessary information we might need
- Embed the meta info into each generated page (via meta tags? via JavaScript section?) during build time and read it per page.
- Add a data attribute to the generated source that indicates the source line number e.g.
<p data-source-line="112">some text</p>
It might be that we need a combination of all the above.
Edited by Jean du Plessis