Readthedocs.org: Still showing .org under "Short URLs"

Created on 8 Jun 2016  路  12Comments  路  Source: readthedocs/readthedocs.org

Based on "Securing Subdomains," I would expect to see foo.readthedocs.io under "Shorter URLs" in the sidebar on project pages, but I still see foo.readthedocs.org. E.g.:

screen shot 2016-06-08 at 5 01 41 pm

https://readthedocs.org/projects/gratipay/

Looks like PRODUCTION_DOMAIN is a config value. Not sure how that interacts with the management interface for the site. I suspect fixing this could be more complicated than simply changing that value in settings, but maybe it _is_ that simple. :-)

Bug Good First Issue patch

Most helpful comment

Hi @agjohnson
I just configured local setup would like to start with this bug.

All 12 comments

Hi @agjohnson
I just configured local setup would like to start with this bug.

@ronakkhunt sure thing, feel free to open a PR and we can work from there. The change should be a minor template change. I believe -- without looking at it -- that the template just uses a hard-coded short URL.

@agjohnson No it's not hard-coded. it using PRODUCTION_DOMAIN value from settings.

Snippet:
<p>
<a href="http://{{ project.slug}}.{{ PRODUCTION_DOMAIN }}">{{ project.slug }}.{{ PRODUCTION_DOMAIN }}</a><br>
{% if PRODUCTION_DOMAIN == "readthedocs.org" %}
<a href="http://{{ project.slug}}.rtfd.io">{{ project.slug }}.rtfd.io</a>
{% endif %}
</p>
Changing PRODUCTION_DOMAIN value in not an option here.
I can hard-code "readthedocs.io", but what is this if condition for?

@ronakkhunt the correct setting is PUBLIC_DOMAIN. The other instances of hardcoded domains can be changed from .org -> .io

@agjohnson
Okey, so final HTML block will be like this...

  <p>
    <a href="http://{{ project.slug}}.{{ PUBLIC_DOMAIN }}">{{ project.slug }}.{{ PUBLIC_DOMAIN }}</a><br>
    {% if PUBLIC_DOMAIN == "readthedocs.io" %}
    <a href="http://{{ project.slug}}.rtfd.io">{{ project.slug }}.rtfd.io</a>
    {% endif %}
  </p>

Also I have added PUBLIC_DOMAIN in context_processor.py (or it can be added in context of view specifically)

Though I do not have production settings' file, I have tested it in local setup given PUBLIC_DOMAIN value in production setting is set as readthedocs.io.

@agjohnson

@ronakkhunt are you still looking at this issue? I'm considering to give it a try too.

This looks fine, @ronakkhunt could you open a PR for this?

Okey,
@agjohnson Since this is not a bug, I am going to make PR from master branch.

I'm still seeing the .org at https://readthedocs.org/projects/gratipay/. What's your release schedule like?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dxgldotorg picture dxgldotorg  路  3Comments

gtalarico picture gtalarico  路  4Comments

enielse picture enielse  路  4Comments

lennartkoopmann picture lennartkoopmann  路  4Comments

JiaweiZhuang picture JiaweiZhuang  路  3Comments