I'm interested in adding opengraph (<https://ogp.m...
# dokka
d
I'm interested in adding opengraph (https://ogp.me/) support to dokka. I have the following 2 questions: 1. Is there an existing extension point a plugin could use to implement this? If not, would you consider adding one that allows this and similar things to be implemented as plugins? 2. Would this be a feature that you are interested in having in dokka? If so I would be willing to develop it as a PR to dokka.
i
Hi! It looks interesting. Unfortunately, I've never worked with opengraph, so I'll ask some silly questions: 1. Am I correct to understand that opengraph is primarily used for rich previews (i.e custom img/title/description instead of just a link) when sharing links on a social media? 2. In order to implement it, do you only need to write some tags to each page's
<head>
part? This is how we construct html pages: HtmRenderer. If you had an extension point that allows you to add additional head tags, would that be enough? At the moment, there's very little html customization available to plugins (only some static substitutions like the logo or footer text). We'd like to implement some sort of html templates so that plugins could heavily customize rendered html pages, but there's no ETA on this yet
d
1. Yes. For example with https://ogp.me/ it is what makes the embed show at the bottom of the message. 2. Yes, that is all that is needed. I was already able to implement simple support by modifying dokka, however I couldn't figure out how to display any data other than
page.title
(which is used in the title head element) as I am not very familiar with dokka internal models. Better templating support sounds awesome to me, but I understand how that would be a big undertaking.
i
I see, thanks! I'll raise this question internally with the team. If there are no strong objections, maybe it's worth implementing as a general dokka feature. Internal model is indeed somewhat confusing at first and the lack of documentation isn't helping, but there's a lot of reusable code. We'll try to help where we can
👍 1