BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.29k stars 1.9k forks source link

Sharing content via MS Teams - Thumbnail/Text Preview #4801

Open alexapropt opened 9 months ago

alexapropt commented 9 months ago

Describe the feature you'd like

Integration of content in BookStack and sharing in MS Teams, with thumbnail and/or text (~1 paragraph) to contextualize the Teams's user about the new section/paragraph via link, as usual on some social networks.

Describe the benefits this would bring to existing BookStack users

Will help disseminate the content produced and preserved in BookStack in third-party applications, ensuring that the information repository remains in the same application and its dissemination helps the sharing of information.

Can the goal of this request already be achieved via other means?

No.

Have you searched for an existing open/closed issue?

How long have you been using BookStack?

Under 3 months

Additional context

No response

DanielGordonIT commented 9 months ago

Most of the embed stuff you see in link embedding on chat platforms is via the OpenGraph standard - which you can do via the "custom head" setting in the settings. Microsoft Teams uses it as well, and Microsoft has an article with resources for integrating it with Microsoft products.

This snippet:

<meta property="og:image" content="https://your.bookstack/uploads/images/system/20XX-XX/your_logo.png">

will give you a thumbnail for your page, with your logo as the image (assuming you change the content path to point at your logo image. You can pull it from any page by looking at the HTML of the logo section). I don't have a good way off the top of my head to pull page content and put it in a meta tag as a summary under the og:description property - this seems like a less-common use-case, and also could leak data if done improperly.

There are also FOUR required properties - og:title, og:type, og:url, and og:image. We can do the image easily, and the same for og:type (which will almost always be "website" or "article" for a wiki like BookStack), but the og:url and og:title require the page's link and title, respectively, and I don't know how to do that dynamically via the "custom head" option.

I also cannot tell if you're asking for a link to a page to embed via the usual OpenGraph standard, or if you want only the most recent change ("...to contextualize the Teams's user about the new section/paragraph via link", italics mine) to be explained by the embed.

There's probably some fancy PHP you could do to add a summary, url, and title in, and/or the most recent revision's change notes, but that seems like a LOT of work for not a lot of reward.

DanielGordonIT commented 9 months ago

Also - if your BookStack instance does not have guest access, and/or is hosted internally (i.e. not able to be hit from the wider internet), the OpenGraph tags won't help, as the Teams client won't see the site (unless it does the query from the client and not a central server, but that only helps with the internal network issue, not the guest access issue).