Make font-family as configurable parameter() ()

We look for fonts object within siteConfig.js
This commit is contained in:
jonathan-cowling 2018-01-22 03:54:52 +00:00 committed by Joel Marcey
parent e0704d0f55
commit a241a46669
3 changed files with 38 additions and 1 deletions
lib/server

View file

@ -487,6 +487,18 @@ function execute(port) {
.string();
cssContent = cssContent.replace(new RegExp('\\$codeColor', 'g'), codeColor);
if (siteConfig.fonts) {
Object.keys(siteConfig.fonts).forEach(key => {
const fontString = siteConfig.fonts[key]
.map(font => '"' + font + '"')
.join(', ');
cssContent = cssContent.replace(
new RegExp('\\$' + key, 'g'),
fontString
);
});
}
res.send(cssContent);
});