Allow search engines to crawl /offline &co

pull/513/head
Thibaut Courouble 8 years ago
parent 6f75f3c44d
commit 0cb57d5e98

@ -41,6 +41,7 @@ page.show = (path, state) ->
currentState = context.state
page.dispatch(context)
context.pushState()
updateCanonicalLink()
track()
context
@ -50,6 +51,7 @@ page.replace = (path, state, skipDispatch, init) ->
currentState = context.state
page.dispatch(context) unless skipDispatch
context.replaceState()
updateCanonicalLink()
track() unless init or skipDispatch
context
@ -177,6 +179,10 @@ onclick = (event) ->
isSameOrigin = (url) ->
url.indexOf("#{location.protocol}//#{location.hostname}") is 0
updateCanonicalLink = ->
@canonicalLink ||= document.head.querySelector('link[rel="canonical"]')
@canonicalLink.setAttribute('href', "http://#{location.host}#{location.pathname}")
track = ->
ga?('send', 'pageview', location.pathname + location.search + location.hash)
_gauges?.push(['track'])

@ -1,6 +1,2 @@
User-agent: *
Disallow: /about
Disallow: /news
Disallow: /tips
Disallow: /help
Disallow: /offline
Allow: /
Loading…
Cancel
Save