diff --git a/doc/custom_static.md b/doc/custom_static.md new file mode 100644 index 00000000..f646e3ba --- /dev/null +++ b/doc/custom_static.md @@ -0,0 +1,11 @@ +# Custom static files +Etherpad Lite allows you to include your own static files in the browser, by modifying the files in `static/custom`. + +* `index.js` Javascript that'll be run in `/` +* `index.css` Stylesheet affecting `/` +* `pad.js` Javascript that'll be run in `/p/:padid` +* `pad.css` Stylesheet affecting `/p/:padid` +* `timeslider.js` Javascript that'll be run in `/p/:padid/timeslider` +* `timeslider.css` Stylesheet affecting `/p/:padid/timeslider` +* `favicon.ico` Overrides the default favicon. +* `robots.txt` Overrides the default `robots.txt`. \ No newline at end of file diff --git a/doc/all.md b/doc/index.md similarity index 76% rename from doc/all.md rename to doc/index.md index f1e071a6..db7cefaa 100644 --- a/doc/all.md +++ b/doc/index.md @@ -1,4 +1,5 @@ @include documentation +@include cusotm_static @include api/api @include plugins @include database diff --git a/src/node/hooks/express/specialpages.js b/src/node/hooks/express/specialpages.js index a5834492..50d27700 100644 --- a/src/node/hooks/express/specialpages.js +++ b/src/node/hooks/express/specialpages.js @@ -12,8 +12,16 @@ exports.expressCreateServer = function (hook_name, args, cb) { //serve robots.txt args.app.get('/robots.txt', function(req, res) { - var filePath = path.normalize(__dirname + "/../../../static/robots.txt"); - res.sendfile(filePath); + var filePath = path.normalize(__dirname + "/../../../static/custom/robots.txt"); + res.sendfile(filePath, function(err) + { + //there is no custom favicon, send the default robots.txt which dissallows all + if(err) + { + filePath = path.normalize(__dirname + "/../../../static/robots.txt"); + res.sendfile(filePath); + } + }); }); //serve favicon.ico