- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 30
Allow dirhtml builder without ogp_site_url
#84
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
Allow dirhtml builder without ogp_site_url
#84
Conversation
I saw those, looking again it seems the problem was introduced in #78. It errors with this:
Or a full traceback:
The root problem was a call Other possible solutions:
|
I think
is fine to restore previous behavior. |
- Yes, the readme says that ogp_site_url is very important. And indeed, reports online say that OGP doesn't work with relative URLs. Although at least one place says it does... - Yet, I got confused when I could build it with html (it left everything relative), but not with dirhtml (obscure extension error it took me a while to figure out). (And it only fails on the page named `/index`. - Set the default ogp_site_url to "" by default, instead of None, to make relative by default (previous behavior) instead of raising an exception. - Even if this isn't perfect, it helps a bit with "make this extension do something useful, even if not perfect, if it's installed but not configured". - So overall, even though this isn't a perfect change, and could be considered technically incorrect, I think it's less confusing and makes things more consistent for a possibly better solution later.
686c400
to
756d9e9
Compare
Updated and tested on my own site. Found and fixed one unintended consequence, but not sure if there could be others - doesn't seem so. |
Ah right, I had Maybe add some test cases to this PR to help avoid regressions in the future? |
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
thanks for this and the other one! |
So, I see that I forgot to |
I think it's ok. The rtd default one has no rtd or opengraph specific configuration. |
indeed, reports online say that OGP doesn't work with relative URLs.
Although at least one place says it does...
everything relative), but not with dirhtml (obscure extension error
it took me a while to figure out). (And it only fails on the page
named
/index
.when ogp_site_url is unset. But then I realized what the root issue
was, and thought that something less invasive, keeping existing
behavior, even if it wasn't perfect. Then we can see where to go
from there.
do something useful, even if not perfect, if it's installed but not
configured".
/index
work with dirhtml without anyconfiguration, since
urljoin
works withNone
as a first argumentto leave the URLs as relative. This seemed like the the most
consistent and least invasive change.
considered technically incorrect, I think it's less confusing and
makes things more consistent for a possibly better solution later.