]>
git.r.bdr.sh - rbdr/blog/blob - config/config.js
476bcfa312d800462b7b94e8cd1ed02cbebd90bf
3 const Path
= require('path');
4 const Getenv
= require('getenv');
9 * The main configuration object for Blog. It will be used to
10 * initialize all of the sub-components. It can extend any property of
14 * @typedef {object} tConfiguration
15 * @property {number} maxPosts=3 the max number of posts that can exist
17 * @property {string} postsDirectory=<project_root>/.posts the location of
18 * the directory where the posts will be stored.
19 * @property {string} staticDirectory=<project_root>/static the location of
20 * the directory where the generated files will be placed. NOTE: There
21 * are some pre-built style files in the default directory, if you
22 * select another one, make sure you include them manually.
23 * @property {string} templatesDirectory=<project_root>/templates the
24 * location of the templates we'll use to generate the index.html
26 module
.exports
= internals
.Config
= {
27 maxPosts: Getenv
.int('BLOG_MAX_POSTS', 3),
28 postsDirectory: Getenv('BLOG_POSTS_DIRECTORY', Path
.resolve(Path
.join(__dirname
, '../.posts'))),
29 archiveDirectory: Getenv('BLOG_ARCHIVE_DIRECTORY', Path
.resolve(Path
.join(__dirname
, '../.archive'))),
30 staticDirectory: Getenv('BLOG_STATIC_DIRECTORY', Path
.resolve(Path
.join(__dirname
, '../static'))),
31 templatesDirectory: Getenv('BLOG_TEMPLATES_DIRECTORY', Path
.resolve(Path
.join(__dirname
, '../templates')))