jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
528 stars 47 forks source link

Social cards for the base URL are redirect images. #149

Closed justinxzhao closed 1 year ago

justinxzhao commented 1 year ago

Summary

Social media cards for http://ludwig.ai/latest is working as intended.

However, when sharing http://ludwig.ai on social media, the social card is a "redirect" box.

This is our publish command:

mike deploy --push --update-aliases ${{ env.ludwig_version }} latest  --no-redirect --title="${{ env.ludwig_version }} (latest)"

Is there a way to configure mike to continue to make /latest be the canonical URL while preserving social media cards (or at least not rendering a "redirecting" card) for when http://ludwig.ai is shared?

Configuration and Logs

Thanks in advance for any guidance you might have on this!

jimporter commented 1 year ago

Thanks for the report. This is happening because the main index page is a redirect.

This is a duplicate of #106, though I'm not sure it's actually possible to do what that issue says.

jimporter commented 1 year ago

That said, the main index.html page is just a regular HTML file, and so long as it does the right thing regarding redirects, you can use any HTML file you like. It shouldn't be too hard to edit index.html in your gh-pages branch to include the necessary metadata and then just push that upstream.

justinxzhao commented 1 year ago

@jimporter thanks for the reply!

We'll give editing index.html in our gh-pages branch to include the necessary metadata a try and report back. Appreciate the advice.