I’d like to build off of the answer in this question.
I want to modify the background image of slides that meet a certain criteria. In this case I want to apply new attributes to the title slide and all level 1 header slides. This function successfully targets all level 1 headers, but I’m not sure how to target the title slides as well.
I know I can do this in the YAML header for the individual Quarto Presentation file, but I’m creating a template for my organization and would like to keep this background modification as simple and easy to maintain as possible, by keeping it in one place.
function Header(el)
if el.level == 1 then
el.attributes["data-background-image"] = "bg.png"
el.attributes["data-background-position"] = "left"
el.attributes["data-background-opacity"] = "0.25"
el.attributes["data-background-size"] = "33%"
return el
end
end
I’ve tried this, based on my super limited lua knowledge, but it doesn’t work.
function Header(el)
if el.level == 1 or el.classes:includes("title-slide") then
el.attributes["data-background-image"] = "bg.png"
el.attributes["data-background-position"] = "left"
el.attributes["data-background-opacity"] = "0.25"
el.attributes["data-background-size"] = "33%"
return el
end
end
And finally, the minimal example that I’ll work with comes from the answer to the linked question.