Prevent crawling of nojs pages
Reported by @dav-is via Gitter chat:
It looks like Google crawled the community site while it was experiencing JS issues and ended up recording some nojs URLs.

Some sort of countermeasures are needed to keep search engines away from these URLs.
It might also be a good idea to use Google web tools to get the site recrawled, so people won't follow the links to these URLs.
Seems like a issue with the server configuration (and possibly robots.txt file) then a issue with flarum itself.. In any case, this post looks helpful
robots.txt
Disallow: /*?nojs=1
I agree it's not a core issue. But it nicely shows the kind of problems that you get when doing single-page applications... sigh
We can leave this one open as a reminder to fix it, though.
It's the sort of thing that admins won't know to fix unless we tell them.
If the robots.txt syntax suggested by @kulga will do the trick (I hadn't realized robots.txt could be used that way) then this could be handled by a super-slick installer. It could create a robots.txt file containing this line ... problem solved, yes?
If that sounds good, I'll add a note to the installer discussion issue pointing at this one.
Couldn't the robot.txt just be placed in flarum's root directory?
Would that work even if Flarum is installed in a subdirectory? ... I've been under the impression that robots.txt has to be in the web root, or it may be ignored.
Maybe we should just add this to the installation docs, instead? It's a simple enough procedure.
What about using canonical URL meta tags?
@dcsjapan Yeah. Just looked it up. It has to be at the root
Another option is Google has settings on crawling with the webmaster tools

@dav-is But google probably isn't the only search engine we need to fix this for :)
Posting for further reference: https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag
As discussed in flarum/flarum#36, we will build a middleware that sends a special header on these pages.
P.S.: @sijad wants to do this.
@franzliedke is it a good idea to add those tags in app view header?
Would it be better to be using a canonical URL meta tag rather than a noindex directive?
@tobscure yes it seems a better solutions. should I PR a new one?
Or maybe in addition to noindex. Because canonical URL should probably be constructed and set by individual controllers (eg, DiscussionController) rather than just by stripping ?nojs=1 off the end of the current URL...
Yes, we should allow controllers to generate a canonical URL, and if we have one, the view will print the meta tag.
Speaking of canonical urls, should the discussion list have a canonical url that doesn't have the post number in it? For example: forum.example/d/5/77 => forum.example/d/5
not sure I understand @dav-is?
Well the page forum.example/d/5 would have the same content at forum.example/d/5/8 and the same content as forum.example/d/5/9. There's overlap in content so should we just remove the post number from the url using the canonical tag? When google crawls, doesn't it scroll down and load all the posts?