Migrate site templates to yaml config (#7189)

Does some winter cleaning on the site-template stuff :)

1. Migrated away from the custom conf format to plain old yaml
2. Made the images and image files match with the name from the yaml
file. (It's not a problem to have spaces in file paths, nor urls so I
don't see why we shouldn't)
3. Updated the relevant documentation

There is a small breakage in the api response for the meta field. It now
returns `{"screenshot_dimensions":{"width":1000,"height":800}}` which I
believe is a lot more useful than
`{"meta.screenshot_dimensions":"1000x800"}`

Besides, I don't believe this endpoint has any third-party consumers
that rely on the metadata since it's a rarely known feature anyways
This commit is contained in:
Mats Jun Larsen
2024-12-08 00:59:58 +09:00
committed by GitHub
parent 16a64df23f
commit c256b922f7
117 changed files with 102 additions and 96 deletions

View File

@@ -23,10 +23,21 @@
// POSSIBILITY OF SUCH DAMAGE.
export type SiteTemplatesMetadata = {
screenshot_dimensions?: string;
screenshot_dimensions: {
width: number;
height: number;
};
};
export type SiteTemplatesType = {
export type SiteTemplateConfiguration = {
meta: SiteTemplatesMetadata;
templates: {
name: string;
reference: string;
}[];
};
export type SiteTemplateResponse = {
meta: SiteTemplatesMetadata;
templates: Record<string, string>;
};