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: Went with Wladimir suggestion Created Dec. 18, 2015, 11:08 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):
+ parts = path.split("/")
+ if parts[-1] == "index":
+ parts.pop()
+ return "/".join(parts)
« 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