-
Notifications
You must be signed in to change notification settings - Fork 599
Description
Currently, if a BCR API documentation page is posted to Slack or Discord, it results in the following generic OpenGraph image:
It would be nice if it instead included something like this:
# [email protected] docs
Rules for foo language.An additional cool feature could be to show the documentation for a specific module/rule/macro/extension module when it is linked. This won't work out of the box though, since the full documentation is currently on one page, and everything is navigated using fragments (which aren't sent to the server). A possible way for this is to make links like this:
https://registry.bazel.build/docs/rules_foo/1.2.3?path=function-foo_library
Which are just redirects to the same page with a fragment, but autodetects OpenGraph crawlers and instead of redirecting returns an empty page with OpenGraph metadata about the specific rule in question. The links on the page can then be rewritten using JS when the page is loaded (but with an event handler to just navigate to the fragment instead; this way, copying the link gives you the query version but clicking doesn't navigate you to another page). This would require some server-side work though, I don't know if the BCR site is fully static or not.