Open choldgraf opened 1 year ago
The site url is already autopopulated on ReadTheDocs so that case is taken care of. I'm weary of automatically setting the site url in Github Actions. If a user uses Github Actions to build their docs and deploys the built docs/artifacts elsewhere, the url will silently be wrong.
If there's a way on Github Actions to detect if the build is being deployed to Github Pages, then I'd be open to adding the auto site url there too.
The
ogp_site_url
field is the only one strictly required by this extension, but I find that folks often forget to set it nonetheless. On many CI/CD systems, there are often environment variables that could be used as a fallback ifsite_url
isn't present. This might be helpful for folks that forget or that simply don't want to have to worry about manually specifying the URL.For example:
GitHub or ReadTheDocs examples
GitHub Actions have default environment variables for all actions. ReadTheDocs also has default environment variables.
Assuming that a person building Sphinx with GitHub Actions is using GitHub Pages (and same w/ ReadTheDocs) you could create a site URL using these variables. For example: