Conversation
mturoci
left a comment
There was a problem hiding this comment.
Thanks for working on this @seagulley! I would like to see some demo to test these changes in action.
| PreviewImage string | ||
| PreviewTitle string | ||
| PreviewDescription string |
There was a problem hiding this comment.
Make these part of the https://github.com/h2oai/wave/blob/94bf37f538719ad279a41b0df1b452623d61aaa4/conf.go#L71C7-L71C7 as well to expose new options to the users.
Also document here.
There was a problem hiding this comment.
I'll get started on this as well as a demo :)
There was a problem hiding this comment.
Hi Martin,
I started working on the demo. Using Meta's Open Graph debugger, it can read the custom title and description, but there are some issues with the image.


I did some more digging and there are some guidelines for adding images to preview links
https://developers.facebook.com/docs/sharing/best-practices/#precaching
How should I approach this?
There was a problem hiding this comment.
The warning says all it needs are og:image:height and og:image:width props. I would first try it out to see if they help. If they do, the next step would be to validate passed image dimensions and:
- If the image does not adhere to the recommended ratio or is too small, log warning and use the actual dimensions for the respective props.
- If the image ratio is good and >= required dimensions, use the copy of the image resized to the expected dimensions.
Hope that makes sense.
There was a problem hiding this comment.
Yes that makes sense I'll get started on it!
| } | ||
|
|
||
| func mungeIndexPage(baseURL, html string) string { | ||
| func mungeIndexPage(baseURL, html string, previewImage string, previewTitle string, previewDescription string) string { |
There was a problem hiding this comment.
nit: Should be enough.
| func mungeIndexPage(baseURL, html string, previewImage string, previewTitle string, previewDescription string) string { | |
| func mungeIndexPage(baseURL, html, previewImage, previewTitle, previewDescription string) string { |
The PR fulfills these requirements: (check all the apply)
mainbranch.feat: Add a button #xxx, where "xxx" is the issue number).Closes #xxx, where "xxx" is the issue number.uifolder, unit tests (make test) still pass.Added new variables to conf.go ServerConf: PreviewImage, PreviewTitle, PreviewDescription.
Modified web_server.go to use these new values as meta tags in the header of the root index.html.
Closes #2184