Commit 4f340f50 authored by Andrew Gerrand's avatar Andrew Gerrand

godoc: canonicalize codewalk paths

R=rsc
CC=golang-dev
https://golang.org/cl/1729046
parent 71675c6f
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div id="code-area"> <div id="code-area">
<div id="code-header" align="center"> <div id="code-header" align="center">
<a id="code-popout-link" href="" target="_blank"> <a id="code-popout-link" href="" target="_blank">
<img title="View code in new window" alt="Pop Out Code" src="popout.png" style="display: block; float: right;"/> <img title="View code in new window" alt="Pop Out Code" src="/doc/codewalk/popout.png" style="display: block; float: right;"/>
</a> </a>
<select id="code-selector"> <select id="code-selector">
{.repeated section File} {.repeated section File}
......
...@@ -63,6 +63,11 @@ func codewalk(c *http.Conn, r *http.Request) { ...@@ -63,6 +63,11 @@ func codewalk(c *http.Conn, r *http.Request) {
return return
} }
// Canonicalize the path and redirect if changed
if redirect(c, r) {
return
}
b := applyTemplate(codewalkHTML, "codewalk", cw) b := applyTemplate(codewalkHTML, "codewalk", cw)
servePage(c, "Codewalk: "+cw.Title, "", "", b) servePage(c, "Codewalk: "+cw.Title, "", "", b)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment