Make it possible to add custom attributes to the body tag
Make it possible to add custom attributes to the body tag, from the page frontmatter, similarly to body_class.
I like the idea. However, the parameter you want to add is closely related to the (undocumented) body_class parameter (see your PR 1541). So why don't we combine both approaches? I envision to have parameter body attributes in the frontmatter and giving a map like structure there. E.g.:
JSON:
{
"body_attributes": {
"class": "class_value",
"attrib_2": "value",
"attrib_n": "value"
}
}
YAML:
body_attribute:
class: value
attrib_2: value
attrib_n: value
This way, we had one single way to add the class attribute and possibly one or more custom attributes, too. WDYT?
To be honest, it seems not many users missed the body_class feature so far, and I suspect even less will need the attributes feature - it's just something that will come handy for the pagefind integration. While I agree that combining the two features would make sense and result in a nicer config, I think that the separate parameters are easier to configure, and combining them might be an overkill.
But if you think it's needed for the PR to be accepted I'll do it when I have some free time.