]>
Commit | Line | Data |
---|---|---|
1 | 'use strict'; | |
2 | ||
3 | const Path = require('path'); | |
4 | const Getenv = require('getenv'); | |
5 | ||
6 | const internals = { | |
7 | blogDirectory: Getenv('BLOG_DIRECTORY', Path.resolve(Path.join(__dirname, '../.blog'))), | |
8 | }; | |
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 | */ | |
28 | module.exports = internals.Config = { | |
29 | maxPosts: Getenv.int('BLOG_MAX_POSTS', 3), | |
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'))), | |
33 | staticDirectory: Getenv('BLOG_STATIC_DIRECTORY', Path.resolve(Path.join(__dirname, '../static'))), | |
34 | templatesDirectory: Getenv('BLOG_TEMPLATES_DIRECTORY', Path.resolve(Path.join(__dirname, '../templates'))), | |
35 | remoteConfig: Getenv('BLOG_REMOTE_CONFIG', Path.resolve(Path.join(__dirname, '../.blogremote'))), | |
36 | }; |