-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Open Graph Support #709
Comments
This may actually require work in the Swift-DocC compiler to fully resolve issues where this data is not being rendered appropriately. Technically, Swift-DocC-Render already renders some basic open graph metadata (source), but it only does client-side rendering, which is why it may not always work as expected depending on how the page is shared. We would need to update DocC to add the related meta tags to individual HTML files that it generates for static file hosting solutions like GitHub Pages where there is no server-side logic that could do this. |
Filed an issue on swift-docc to track this. apple/swift-docc#658
Got it. |
Taking WWDC23's demo project - SlothCreator as an example. The generated gettingstarted.json from // GettingStarted.md
@Metadata {
@PageImage(purpose: card, source: "gettingStarted-card", alt: "The profile images for a regular sloth and an ice sloth.")
} will be
So I think there is already enough information provided by swift-docc. We can update the logic from |
To clarify, I think we already have the right data to populate the meta tags needed for this—however, I think the logic will need to live in Swift-DocC since it would need to dynamically generate the right metadata in the individual HTML files that it produces as part of supporting static hosting environments. We can update the |
Got the point. We should do the logic when swift-docc produce the static HTML file if possible. |
Feature Name
Add Open Graph Support
Description
Currently when sharing a documentation(Article or Tutorial), the url is render as a pure title card.
If there is image information available, we should add
og:image
to html header to better render the doc link in other site.eg.
Metadata directive's PageImage parameter
https://forums.swift.org/t/feature-suggestion-add-open-graph-support/65989
The text was updated successfully, but these errors were encountered: