https://kotlinlang.org logo
Title
s

Sander Ploegsma

04/18/2019, 8:11 AM
Does anyone know how to add OpenGraph meta tags using the HTML DSL? I need to be able to add tags such as
<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

r4zzz4k

04/18/2019, 8:29 AM
There is a map-like property called
attributes
.
s

Sander Ploegsma

04/18/2019, 8:42 AM
Good suggestion, it looks like this works:
meta {
    attributes["prefix"] = "og <http://ogp.me/ns#>"
    attributes["property"] = "og:title"
    content = "title"
}
Thanks for the help!