Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

documenting some of the code more, updated env fallbacks

  • Loading branch information...
commit 7e259c2742dcb8ffec06ad9d3d35932668bb94fe 1 parent 2e2ebf4
@balupton balupton authored
Showing with 14 additions and 7 deletions.
  1. +2 −2 app/out/docpad.js
  2. +12 −5 app/src/docpad.coffee
View
4 app/out/docpad.js
@@ -256,7 +256,7 @@ docpadConfig = {
return next();
});
if (!(process.env.BEVRY_GITHUB_CLIENT_ID && process.env.BEVRY_GITHUB_CLIENT_SECRET)) {
- docpad.log('warn', "Unable to Fetch Contributors!");
+ docpad.log('warn', "Cannot fetch contributors if the BEVRY_GITHUB_CLIENT_ID and BEVRY_GITHUB_CLIENT_SECRET environment variables are not set.");
return next();
}
contributorFeeds = ["https://api.github.com/users/docpad/repos?client_id=" + process.env.BEVRY_GITHUB_CLIENT_ID + "&client_secret=" + process.env.BEVRY_GITHUB_CLIENT_SECRET, "https://api.github.com/users/bevry/repos?client_id=" + process.env.BEVRY_GITHUB_CLIENT_ID + "&client_secret=" + process.env.BEVRY_GITHUB_CLIENT_SECRET];
@@ -319,7 +319,7 @@ docpadConfig = {
docpad = this.docpad;
request = require('request');
server.all('/pushover', function(req, res) {
- if (__indexOf.call(docpad.getEnvironments(), 'development') >= 0) {
+ if (__indexOf.call(docpad.getEnvironments(), 'development') >= 0 || (process.env.BEVRY_PUSHOVER_TOKEN != null) === false) {
return res.send(200);
}
return request({
View
17 app/src/docpad.coffee
@@ -229,13 +229,19 @@ docpadConfig =
# =================================
- # DocPad Plugins
+ # Plugins
+ # Alias stylus highlighting to css and there is no inbuilt stylus support
plugins:
highlightjs:
aliases:
stylus: 'css'
+
+ # =================================
+ # Environments
+
+ # Disable analytic services on the development environment
environments:
development:
templateData:
@@ -248,7 +254,7 @@ docpadConfig =
# =================================
- # DocPad Events
+ # Events
events:
@@ -317,7 +323,7 @@ docpadConfig =
# If the GitHub Tokens are Missing, Skip Contributors
unless process.env.BEVRY_GITHUB_CLIENT_ID and process.env.BEVRY_GITHUB_CLIENT_SECRET
# Log
- docpad.log('warn', "Unable to Fetch Contributors!")
+ docpad.log('warn', "Cannot fetch contributors if the BEVRY_GITHUB_CLIENT_ID and BEVRY_GITHUB_CLIENT_SECRET environment variables are not set.")
# Done
return next()
@@ -379,9 +385,10 @@ docpadConfig =
docpad = @docpad
request = require('request')
- # Pushover
+ # Pushover - Optional
+ # Called by the 404 page to alert our mobile phone of missing pages
server.all '/pushover', (req,res) ->
- return res.send(200) if 'development' in docpad.getEnvironments()
+ return res.send(200) if 'development' in docpad.getEnvironments() or process.env.BEVRY_PUSHOVER_TOKEN? is false
request(
{
url: "https://api.pushover.net/1/messages.json"
Please sign in to comment.
Something went wrong with that request. Please try again.