You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently switched our site to use the Material theme for Mkdocs, and we've been trying to take advantage of their Social Cards feature. The plugin uses two python libraries, pillow and cairosvg to generate attractive thumbnails for your site that get used in social media posts, chat links, etc.
The library generates PNG files that are expected to be included in the _build/html directory as part of the mkdocs build output, and then uploaded to the CDN along with the rest of our image assets. We added a couple of debug commands to our build via a post_build step, and we can see in the output that the files are indeed being generated in the correct location as expected. However, we have not seen them served as part of the site content yet.
The files we are missing are located at _build/html/assets/images/social
Also of note is that so far we have only tested in PR builds. Not sure if the CDN upload behaves differently in those cases.
Expected Result
When I load any page in my site, there will be some meta tags in the <head> , like so:
@stsewd oh! i see now that the URLs to those images are statically generating from the site_url that we feed in via mkdocs.yml. I guess I assumed the PR builds would overwrite site_url so that links like this would work in those builds, but I didn't notice that the domain itself is different for PR builds. Is there something we can do config-wise to have that URL replaced in PR builds so we can test these things without merging?
Details
We recently switched our site to use the Material theme for Mkdocs, and we've been trying to take advantage of their Social Cards feature. The plugin uses two python libraries,
pillow
andcairosvg
to generate attractive thumbnails for your site that get used in social media posts, chat links, etc.The library generates PNG files that are expected to be included in the
_build/html
directory as part of themkdocs build
output, and then uploaded to the CDN along with the rest of our image assets. We added a couple of debug commands to our build via apost_build
step, and we can see in the output that the files are indeed being generated in the correct location as expected. However, we have not seen them served as part of the site content yet.The files we are missing are located at
_build/html/assets/images/social
Also of note is that so far we have only tested in PR builds. Not sure if the CDN upload behaves differently in those cases.
Expected Result
When I load any page in my site, there will be some
meta
tags in the<head>
, like so:The url in the
content
property should resolve to an image.Actual Result
The meta tag is populated as expected in the above output, but the URL results in a 404 instead of an image loading.
The text was updated successfully, but these errors were encountered: