readthedocs / addons

JavaScript client to integrate with Read the Docs nicely
https://readthedocs-addons.readthedocs.io/
MIT License
21 stars 6 forks source link

Addons based on HTTP status code #385

Open humitos opened 2 months ago

humitos commented 2 months ago

In https://github.com/readthedocs/addons/pull/373 we started making usage of the HTTP status code to decide whether or not show specific addons on those pages. We are not showing the flyout and ad on 404 pages, for example. However, if the page is customized (using sphinx-notfound-page) I think we still want to show them. What would be a good way to implement this logic? Should we add another META tag via CF to communicate if the 404 page is custom or not?

humitos commented 1 month ago

Examples:

Those pages should show the flyout menu at the bottom right, but it's not there.

humitos commented 1 week ago

What would be a good way to implement this logic? Should we add another META tag via CF to communicate if the 404 page is custom or not?

@agjohnson what do you think?

agjohnson commented 1 week ago

It doesn't feel like there is a good blanket default here. Even if a user has a custom 404 page they might still not want the flyout, notifications, or other addons on their error pages. This might come down to explicit configuration.

humitos commented 1 week ago

Yeah, that probably makes sense. What granularity of explicit configuration are you thinking about? Per addon? Per http status code? Both? Like,

agjohnson commented 1 week ago

Hrm, not sure really. I'm not feeling we need to offer configuration options by status code, that feels excessive.

If we have enough users asking for this, it maybe is worth a configuration option on each addon. I expect that themes are most likely to dictate whether error pages have our elements on them though. It would be good to design starting from there probably.

humitos commented 1 week ago

OK, that makes sense. I will leave this issue aside for now then until we have more feedback from users. There is no need to complicate it currently, in particular, if we don't have the use cases well defined.