Unified · Split
| @@ -41,6 +41,7 @@ page.show = (path, state) -> · 40 unmodified lines | ||
| 41 | 41 | currentState = context.state |
| 42 | 42 | page.dispatch(context) |
| 43 | 43 | context.pushState() |
| 44 | + updateCanonicalLink() | |
| 44 | 45 | track() |
| 45 | 46 | context |
| 46 | 47 | |
| @@ -50,6 +51,7 @@ page.replace = (path, state, skipDispatch, init) -> · 3 unmodified lines | ||
| 50 | 51 | currentState = context.state |
| 51 | 52 | page.dispatch(context) unless skipDispatch |
| 52 | 53 | context.replaceState() |
| 54 | + updateCanonicalLink() | |
| 53 | 55 | track() unless init or skipDispatch |
| 54 | 56 | context |
| 55 | 57 | |
| @@ -177,6 +179,10 @@ onclick = (event) -> · 121 unmodified lines | ||
| 177 | 179 | isSameOrigin = (url) -> |
| 178 | 180 | url.indexOf("#{location.protocol}//#{location.hostname}") is 0 |
| 179 | 181 | |
| 182 | +updateCanonicalLink = -> | |
| 183 | + @canonicalLink ||= document.head.querySelector('link[rel="canonical"]') | |
| 184 | + @canonicalLink.setAttribute('href', "http://#{location.host}#{location.pathname}") | |
| 185 | + | |
| 180 | 186 | track = -> |
| 181 | 187 | ga?('send', 'pageview', location.pathname + location.search + location.hash) |
| 182 | 188 | _gauges?.push(['track']) |
| @@ -1,6 +1,2 @@ | ||
| 1 | 1 | User-agent: * |
| 2 | −Disallow: /about | |
| 3 | −Disallow: /news | |
| 4 | −Disallow: /tips | |
| 5 | −Disallow: /help | |
| 6 | −Disallow: /offline | |
| 2 | +Allow: / | |