api
api copied to clipboard
Support `meta name="description"` tag
api currently does not read <meta name="description" content="" /> field.
Current code: https://github.com/Chatterino/api/blob/605921eaf0265686c6c106fbddf06da6c6508aeb/internal/resolvers/default/metafields.go#L13-L32
A quick & dirty change is to additionally read the "name" property
prop, _ := s.Attr("property")
if prop == "" {
prop, _ = s.Attr("name")
}
and then read "description":
case (prop == "og:description" || prop == "twitter:description" || prop == "description") && data.Description == "":
data.Description = cont
I'll leave this as an issue because I'm sure there are better ways of (re)writing this code.