]> git.r.bdr.sh - rbdr/blog/blame - config/config.js
Make templates more generic
[rbdr/blog] / config / config.js
CommitLineData
cf630290
BB
1'use strict';
2
3const Path = require('path');
4const Getenv = require('getenv');
5
c5cbbd38
RBR
6const internals = {
7 blogDirectory: Getenv('BLOG_DIRECTORY', Path.resolve(Path.join(__dirname, '../.blog'))),
8};
cf630290
BB
9
10/**
11 * The main configuration object for Blog. It will be used to
12 * initialize all of the sub-components. It can extend any property of
13 * the blog object.
14 *
15 * @memberof Blog
16 * @typedef {object} tConfiguration
17 * @property {number} maxPosts=3 the max number of posts that can exist
18 * at one time
19 * @property {string} postsDirectory=<project_root>/.posts the location of
20 * the directory where the posts will be stored.
21 * @property {string} staticDirectory=<project_root>/static the location of
22 * the directory where the generated files will be placed. NOTE: There
23 * are some pre-built style files in the default directory, if you
24 * select another one, make sure you include them manually.
25 * @property {string} templatesDirectory=<project_root>/templates the
26 * location of the templates we'll use to generate the index.html
27 */
28module.exports = internals.Config = {
29 maxPosts: Getenv.int('BLOG_MAX_POSTS', 3),
c5cbbd38
RBR
30 blogDirectory: internals.blogDirectory,
31 postsDirectory: Getenv('BLOG_POSTS_DIRECTORY', Path.resolve(Path.join(internals.blogDirectory, 'posts'))),
32 archiveDirectory: Getenv('BLOG_ARCHIVE_DIRECTORY', Path.resolve(Path.join(internals.blogDirectory, 'archive'))),
cf630290 33 staticDirectory: Getenv('BLOG_STATIC_DIRECTORY', Path.resolve(Path.join(__dirname, '../static'))),
c5cbbd38
RBR
34 templatesDirectory: Getenv('BLOG_TEMPLATES_DIRECTORY', Path.resolve(Path.join(__dirname, '../templates'))),
35 remoteConfig: Getenv('BLOG_REMOTE_CONFIG', Path.resolve(Path.join(__dirname, '../.blogremote'))),
cf630290 36};