NUSComputingDev / CompClubEmailBlast

CompClubEmailBlast is designed to automate the process of sending e-mail blast for NUS Computing Club. It uses the e-mail blast template for the Club.
https://newsletters.nuscomputing.com
GNU General Public License v3.0
1 stars 2 forks source link

Add a secret file to auto-populate the sensitive authentication fields #17

Closed jia1 closed 7 years ago

jia1 commented 7 years ago

Push the example secret file to the repo, and gitignore the real secret file

For example: Given secrets.ini and secrets.ini.example, append *.ini to .gitignore.

jia1 commented 7 years ago

Original plan is to use config.json but currently no idea how to have Pug read from config.json

ZhangYiJiang commented 7 years ago

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 });