Docs: improve comments, error checking and defaults

This commit is contained in:
Pieter Vander Vennet 2024-01-11 05:10:04 +01:00
parent 65da7155fa
commit ac9792ac43
6 changed files with 47 additions and 3 deletions

View file

@ -535,7 +535,7 @@ export class PrepareTheme extends Fuse<LayoutConfigJson> {
new SetDefault("socialImage", "assets/SocialImage.png", true),
// We expand all tagrenderings first...
new On("layers", new Each(new PrepareLayer(state))),
// Then we apply the override all
// Then we apply the override all. We must first expand everything in case that we override something in an expanded tag
new ApplyOverrideAll(),
// And then we prepare all the layers _again_ in case that an override all contained unexpanded tagrenderings!
new On("layers", new Each(new PrepareLayer(state))),

View file

@ -882,6 +882,10 @@ class MiscTagRenderingChecks extends DesugaringStep<TagRenderingConfigJson> {
)
}
if(json.icon?.["size"]){
context.enters("icon","size").err("size is not a valid attribute. Did you mean 'class'? Class can be one of `small`, `medium` or `large`")
}
if (json.freeform) {
if (json.render === undefined) {
context

View file

@ -153,7 +153,7 @@ export default class TagRenderingConfig {
this.renderIconClass = "small"
} else if (typeof json.icon === "object") {
this.renderIcon = json.icon.path
this.renderIconClass = json.icon.class
this.renderIconClass = json.icon.class ?? "small"
}
this.metacondition = TagUtils.Tag(
json.metacondition ?? { and: [] },