b9d86f3989
- Add `---` YAML Front Matter as a workaround to allow the theme gem's version to be overridden locally. - Adjust page scope in Front Matter default to avoid adding a layout to `main.min.js` - Fixes #874, Fixes #722
21 lines
No EOL
638 B
JavaScript
21 lines
No EOL
638 B
JavaScript
const fs = require('fs');
|
|
const pkg = require('./package.json');
|
|
const filename = 'assets/js/main.min.js';
|
|
const script = fs.readFileSync(filename);
|
|
const padStart = str => ('0' + str).slice(-2)
|
|
const dateObj = new Date;
|
|
const date = `${dateObj.getFullYear()}-${padStart(dateObj.getMonth() + 1)}-${padStart(dateObj.getDate())}`;
|
|
const banner = `---
|
|
layout:
|
|
---
|
|
|
|
/*!
|
|
* Minimal Mistakes Jekyll Theme ${pkg.version} by ${pkg.author}
|
|
* Copyright ${dateObj.getFullYear()} Michael Rose - mademistakes.com | @mmistakes
|
|
* Licensed under ${pkg.license}
|
|
*/
|
|
`;
|
|
|
|
if (script.slice(0, 3) != '/**') {
|
|
fs.writeFileSync(filename, banner + script);
|
|
} |