aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2017-07-03 00:55:32 -0500
committerBen Beltran <ben@nsovocal.com>2017-07-03 00:55:32 -0500
commit5e265f9d81bcce30949e88850892ea5dacec7386 (patch)
tree056dfe345174027335cc033359dfbe14a8d53250 /config
parent4ae55e0673a61c50f1f7f378f6461d0388f66bd5 (diff)
parentbe33bb82f6276b05a3861df8a7c5138ac320a00b (diff)
Merge branch 'release/1.0.0'
Diffstat (limited to 'config')
-rw-r--r--config/config.js31
-rw-r--r--config/env.dist0
-rw-r--r--config/jsdoc.json9
3 files changed, 40 insertions, 0 deletions
diff --git a/config/config.js b/config/config.js
new file mode 100644
index 0000000..d16ff2d
--- /dev/null
+++ b/config/config.js
@@ -0,0 +1,31 @@
+'use strict';
+
+const Path = require('path');
+const Getenv = require('getenv');
+
+const internals = {};
+
+/**
+ * The main configuration object for Blog. It will be used to
+ * initialize all of the sub-components. It can extend any property of
+ * the blog object.
+ *
+ * @memberof Blog
+ * @typedef {object} tConfiguration
+ * @property {number} maxPosts=3 the max number of posts that can exist
+ * at one time
+ * @property {string} postsDirectory=<project_root>/.posts the location of
+ * the directory where the posts will be stored.
+ * @property {string} staticDirectory=<project_root>/static the location of
+ * the directory where the generated files will be placed. NOTE: There
+ * are some pre-built style files in the default directory, if you
+ * select another one, make sure you include them manually.
+ * @property {string} templatesDirectory=<project_root>/templates the
+ * location of the templates we'll use to generate the index.html
+ */
+module.exports = internals.Config = {
+ maxPosts: Getenv.int('BLOG_MAX_POSTS', 3),
+ postsDirectory: Getenv('BLOG_POSTS_DIRECTORY', Path.resolve(Path.join(__dirname, '../.posts'))),
+ staticDirectory: Getenv('BLOG_STATIC_DIRECTORY', Path.resolve(Path.join(__dirname, '../static'))),
+ templatesDirectory: Getenv('BLOG_TEMPLATES_DIRECTORY', Path.resolve(Path.join(__dirname, '../templates')))
+};
diff --git a/config/env.dist b/config/env.dist
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/config/env.dist
diff --git a/config/jsdoc.json b/config/jsdoc.json
new file mode 100644
index 0000000..9e05753
--- /dev/null
+++ b/config/jsdoc.json
@@ -0,0 +1,9 @@
+{
+ "plugins": ["plugins/markdown"],
+ "opts": {
+ "destination": "doc",
+ "readme": "README.md",
+ "template": "node_modules/docdash",
+ "recurse": true
+ }
+}