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

Unified Diff: filters/stripindex.py

Issue 29332874: Issue 3435 - strip "index" from page path for canonical URL (Closed)
Patch Set: Created Dec. 18, 2015, 10:28 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | templates/default.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filters/stripindex.py
===================================================================
new file mode 100644
--- /dev/null
+++ b/filters/stripindex.py
@@ -0,0 +1,5 @@
+def stripindex(path):
+ if path.endswith("index"):
+ return path[:-5]
Wladimir Palant 2015/12/18 10:58:15 This logic is wrong - imagine a page called fooind
saroyanm 2015/12/18 11:10:15 Ahh right.
Wladimir Palant 2015/12/18 11:13:44 In fact, given that this logic is only necessary i
saroyanm 2015/12/18 11:24:18 IMO it will affect readability of template file, I
Wladimir Palant 2015/12/18 11:58:31 Fair enough.
+ return path
+
« no previous file with comments | « no previous file | templates/default.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld