File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ func main() {
8787 e .GET ("/articles/:id/assets/*" , s .handleArticleAsset )
8888 e .POST ("/articles/epub" , s .handleEPUB )
8989 e .GET ("/readone.user.js" , serveUserscript )
90+ e .GET ("/robots.txt" , handleRobots )
9091 e .StaticFS ("/assets" , assetsFS )
9192
9293 // The userscript runs on whatever article page the user is reading, so
@@ -108,6 +109,12 @@ func main() {
108109 e .Logger .Fatal (e .Start (":" + port ))
109110}
110111
112+ // This is a personal read-it-later tool, not something meant to be indexed —
113+ // block every crawler rather than trying to enumerate specific ones.
114+ func handleRobots (c echo.Context ) error {
115+ return c .String (http .StatusOK , "User-agent: *\n Disallow: /\n " )
116+ }
117+
111118func (s * server ) handleIndex (c echo.Context ) error {
112119 return c .Blob (http .StatusOK , "text/html; charset=utf-8" , indexHTML )
113120}
You can’t perform that action at this time.
0 commit comments