aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2017-07-03 00:26:08 -0500
committerBen Beltran <ben@nsovocal.com>2017-07-03 00:26:08 -0500
commitcf6302904d61ead65e6294e7f1be406eb68ef5f9 (patch)
tree2d034809bbf8db2db79e413ace9cab44a7044ae6 /config
parent7a5a585ead8c4e967980adc2ab9c7502e47694fd (diff)
✨📝🔧 Add generator bin and files
Includes config for eslint, and jsdoc, plus the executable Squashed commit of the following: commit 7726a2743994800f5c0afbc23e5b529107b79450 Author: Ben Beltran <ben@nsovocal.com> Date: Mon Jul 3 00:25:43 2017 -0500 Update changelog commit 78ad8ab788020c09848a852e48827781aa17341a Author: Ben Beltran <ben@nsovocal.com> Date: Mon Jul 3 00:25:38 2017 -0500 Remove unused image commit 1cd659307a39669cf0fc8d0f676b25625fd16ba2 Author: Ben Beltran <ben@nsovocal.com> Date: Mon Jul 3 00:23:53 2017 -0500 Remove trailing slash on index commit 944160fcbc364e4a829be91e6ad32521b4f94987 Author: Ben Beltran <ben@nsovocal.com> Date: Mon Jul 3 00:21:50 2017 -0500 Add example blog post commit 70645d0214d5d363accfedc3e2583e97232c930e Author: Ben Beltran <ben@nsovocal.com> Date: Mon Jul 3 00:20:44 2017 -0500 ✨ Add binary / generator to lib commit bb8f8bb6e12c89bc4b9b3766fd2ef8e924422005 Author: Ben Beltran <ben@nsovocal.com> Date: Mon Jul 3 00:20:29 2017 -0500 🔧 Add package.json commit 7e9b6f52c1c91bf963319ddeb1696bfac4130b95 Author: Ben Beltran <ben@nsovocal.com> Date: Mon Jul 3 00:19:57 2017 -0500 🔧 Add eslint config commit 26ee06bbf1c2f20620c81fa94c4a9b40460bd401 Author: Ben Beltran <ben@nsovocal.com> Date: Mon Jul 3 00:19:31 2017 -0500 Move static files to template / static commit db84351cbb8e8c4729123650d1cb3a6150da0502 Author: Ben Beltran <ben@nsovocal.com> Date: Sun Jul 2 21:39:20 2017 -0500 Use a hidden name for posts directory
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
+ }
+}