Closed jia1 closed 7 years ago
Original plan is to use config.json
but currently no idea how to have Pug read from config.json
Use either globals or locals https://pugjs.org/api/reference.html. You can directly require
JSON in JS.
const config = require('./config.json');
pug.renderFile('path/to/template.pug', { globals: ['config'] });
// OR
pug.renderFile('path/to/template.pug', { config });
Push the example secret file to the repo, and gitignore the real secret file
For example: Given
secrets.ini
andsecrets.ini.example
, append*.ini
to.gitignore
.