-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbanner.js
39 lines (36 loc) · 1.15 KB
/
banner.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var authorName = "Sammy Baek";
var fs = require("fs");
var pkg = require("./package.json");
var filename = "assets/js/main.min.js";
var script = fs.readFileSync(filename);
var padStart = str => ("0" + str).slice(-2);
var dateObj = new Date();
var date = `${dateObj.getFullYear()}-${padStart(
dateObj.getMonth() + 1
)}-${padStart(dateObj.getDate())}`;
var customBanner =
` * Customized Jekyll Theme by Sammy Baek
* Copyright 2020-${dateObj.getFullYear()} ${authorName}. All rights reserved.`;
var banner = `/*!
${customBanner}
* Powered by
* Minimal Mistakes Jekyll Theme ${pkg.version} by ${pkg.author}
* Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes
* Licensed under ${pkg.license}
*/
`;
if (script.slice(0, 3) != "/*!") {
fs.writeFileSync(filename, banner + script);
}
/* customs js */
var filename = "assets/js/customs.min.js";
var script = fs.readFileSync(filename);
if (script.slice(0, 3) != "/*!") {
fs.writeFileSync(filename, banner + script);
}
/* custom kakao js */
var filename = "assets/js/kakao-custom.min.js";
var script = fs.readFileSync(filename);
if (script.slice(0, 3) != "/*!") {
fs.writeFileSync(filename, banner + script);
}