I guess this may be a ‘lost case’, but is it possible to password protect one or more pages generated by DocPad?
Is it possible to make a plugin or something that let you say protected = true in the metadata section of a page?
Or do I have to use .htaccess or similar to protect my pages?
If you’re planning to host on a node.js hosting provider, then you can use the following gist: https://gist.github.com/4557006
The idea is that we use the
serverExtendevent to add a new express.js middleware. Middlewares added via theserverExtendevent are added before docpad’s middlewares are added, so this is the ideal place for this authetnication layer as well as most other use cases for custom routes/middlewares etc. Our custom middleware will then check to see if the document that is being requested is a protected document or not, if it isn’t it continues down the middleware chain (probably hitting the docpad middlewares and rendering normally) or if it is a protected document then we’ll forward it onto the express basicAuth middleware.