Skip to content
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

Use relative URLs where possible #3766

Merged
merged 3 commits into from
Oct 20, 2019
Merged

Use relative URLs where possible #3766

merged 3 commits into from
Oct 20, 2019

Conversation

javierm
Copy link
Member

@javierm javierm commented Oct 11, 2019

References

Objectives

  • Simlify the code while making it more consistent
  • Remove obsolete URL helpers
  • Remove no longer needed absolute URLs in <a> tags in pagination, which were probably added thinking search engines used them the same way the use <llink> tags (in any case, the rel=prev/next tag doesn't need absolute URLs anymore)

@javierm javierm self-assigned this Oct 11, 2019
@javierm javierm added this to Reviewing in Roadmap via automation Oct 11, 2019
@javierm javierm moved this from Reviewing to Doing in Roadmap Oct 17, 2019
@javierm javierm force-pushed the relative_urls branch 2 times, most recently from 2d3677a to d399424 Compare October 20, 2019 13:10
We now use `polymorphic_hierarchy_path` instead.
The main reason to use it was the `rel` attribute for previous/next
pages not being indexed correctly by certain search engines when using a
relative URL. However, AFAIK that only applied to `<link>` tags, not to
`<a>` tags, and only if a `<base>` tag was defined.

In any case, it looks like the same search engines don't use the `rel`
attribute for previous/next to index pages anymore.
In general, we always use relative URLs (using `_path`), but sometimes
we were accidentally using absolute URLs (using `_url`). It's been
reported i might cause some isuses if accepting both HTTP and HTTPS
connections, although we've never seen the case.

In any case, this change makes the code more consistent and makes the
generated HTML cleaner.
@javierm javierm moved this from Doing to Reviewing in Roadmap Oct 20, 2019
@javierm javierm merged commit 2f9995f into master Oct 20, 2019
Roadmap automation moved this from Reviewing to Release 1.1.0 Oct 20, 2019
@javierm javierm deleted the relative_urls branch October 20, 2019 16:33
@javierm javierm mentioned this pull request Oct 20, 2019
smarques pushed a commit to venetochevogliamo/consul that referenced this pull request Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Roadmap
  
Release 1.1.0
Development

Successfully merging this pull request may close these issues.

New proposal uses http when on a host that is https but uses a proxy
1 participant