Ghost/ghost/settings-path-manager
renovate[bot] 6fc497743d
Updated @tryghost dependencies (#15479)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-12 10:16:05 +07:00
..
lib Added getBackupFilePath to settings-path-manager module 2021-09-30 20:14:21 +02:00
test Added getBackupFilePath to settings-path-manager module 2021-09-30 20:14:21 +02:00
.eslintrc.js Added settings-path-manager module 2021-09-30 19:22:09 +02:00
index.js Added settings-path-manager module 2021-09-30 19:22:09 +02:00
package.json Updated @tryghost dependencies (#15479) 2022-10-12 10:16:05 +07:00
README.md Tidied up package README and LICENSE files 2022-07-26 15:22:10 +02:00

Settings Path Manager

A library which helps locating configuration paths in Ghost. For example configs for dynamic routes or redirects.

Usage

Example use in to create routes.yaml configuration files:

const config = require('../shared/config'); // or whatever place the storage folders are configured at

const settingsPathManager = new SettingsPathManager({
    type: 'routes',
    paths: [config.getContentPath('settings')]
});

const filePath = settingsPathManager.getDefaultFilePath();

console.log(config.getContentPath('settings')); // -> '/content/data/'
console.log(filePath); // -> '/content/data/routes.yaml'