Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29332884: Issue 3435 - add missing trailing slash to the canonical url (Closed)

Created:
Dec. 18, 2015, 5:33 p.m. by saroyanm
Modified:
Dec. 18, 2015, 6:01 p.m.
Reviewers:
Sebastian Noack
CC:
Felix Dahlke
Visibility:
Public.

Description

Issue 3435 - add missing trailing slash to the canonical url

Patch Set 1 #

Total comments: 1

Patch Set 2 : Removed the filter went with jinja2 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -6 lines) Patch
R filters/stripindex.py View 1 1 chunk +0 lines, -5 lines 0 comments Download
M templates/default.tmpl View 1 1 chunk +1 line, -1 line 1 comment Download

Messages

Total messages: 6
saroyanm
Dec. 18, 2015, 5:38 p.m. (2015-12-18 17:38:20 UTC) #1
Sebastian Noack
https://codereview.adblockplus.org/29332884/diff/29332885/templates/default.tmpl File templates/default.tmpl (right): https://codereview.adblockplus.org/29332884/diff/29332885/templates/default.tmpl#newcode24 templates/default.tmpl:24: <link rel="canonical" href="https://eyeo.com/{{page|stripindex}}/"> This will add a redundant slash ...
Dec. 18, 2015, 5:42 p.m. (2015-12-18 17:42:47 UTC) #2
saroyanm
On 2015/12/18 17:42:47, Sebastian Noack wrote: > https://codereview.adblockplus.org/29332884/diff/29332885/templates/default.tmpl > File templates/default.tmpl (right): > > https://codereview.adblockplus.org/29332884/diff/29332885/templates/default.tmpl#newcode24 ...
Dec. 18, 2015, 5:43 p.m. (2015-12-18 17:43:49 UTC) #3
Sebastian Noack
LGTM. Mind adding the <link rel=canonical> tag with this implementation to adblockbrowser.org as well?
Dec. 18, 2015, 5:46 p.m. (2015-12-18 17:46:18 UTC) #4
saroyanm
On 2015/12/18 17:46:18, Sebastian Noack wrote: > LGTM. > > Mind adding the <link rel=canonical> ...
Dec. 18, 2015, 5:50 p.m. (2015-12-18 17:50:44 UTC) #5
Sebastian Noack
Dec. 18, 2015, 6:01 p.m. (2015-12-18 18:01:37 UTC) #6
Message was sent while issue was closed.
https://codereview.adblockplus.org/29332884/diff/29332887/templates/default.tmpl
File templates/default.tmpl (right):

https://codereview.adblockplus.org/29332884/diff/29332887/templates/default.t...
templates/default.tmpl:21: <link rel="canonical" href="https://eyeo.com/{{
page[:-5] if page.endswith('index') else page }}">
Argh, sorry. I just realized that this will break if the page is called like
/somethingindex. The version I initially suggested however won't work for the
top-level index page. So this has to be:

  {{ page[:-5] if page.split('/')[-1] == 'index' else page }}

Powered by Google App Engine
This is Rietveld