Does anyone know how to add OpenGraph meta tags us...
# ktor
s
Does anyone know how to add OpenGraph meta tags using the HTML DSL? I need to be able to add tags such as
Copy code
<meta prefix="og <http://ogp.me/ns#>" property="og:title" content="title" />
But the
META
class doesn't seem to support the
prefix
and
property
attributes. Currently I'm using
unsafe
to render the raw HTML, but I'd prefer not to.
r
There is a map-like property called
attributes
.
s
Good suggestion, it looks like this works:
Copy code
meta {
    attributes["prefix"] = "og <http://ogp.me/ns#>"
    attributes["property"] = "og:title"
    content = "title"
}
Thanks for the help!