-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
114 lines (104 loc) · 4.71 KB
/
Gruntfile.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
module.exports = function(grunt) {
"use strict";
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
build: ['build']
},
postcss: {
options: {
processors: [
require('autoprefixer')
]
},
dist: {
src: ['public_html/css/*.css', 'public_html/examples/**/*.css']
}
},
copy: {
main: {
expand: true,
cwd: 'public_html',
src: "**",
dest: "build/"
}
},
replace: {
adsense: {
options: {
patterns: [
// {
// match: /<!-- ads-html -->/g,
// replacement: ''+
// '<!-- Metro UI - Responsive 1 -->\n' +
// '<ins class="adsbygoogle"\n' +
// ' style="display:block"\n' +
// ' data-ad-client="ca-pub-1632668592742327"\n' +
// ' data-ad-slot="8347181909"\n' +
// ' data-ad-format="auto"' +
// ' data-full-width-responsive="true"></ins>\n' +
// '<script>\n' +
// '(adsbygoogle = window.adsbygoogle || []).push({});\n' +
// '</script>'
// },
// {
// match: /<!-- ads-script -->/g,
// replacement: '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>'
// },
{
match: /<!-- ga-script -->/g,
replacement: '<!-- Global site tag (gtag.js) - Google Analytics -->\n' +
`<!-- Global site tag (gtag.js) - Google Analytics -->\n`+
`<script async src="https://www.googletagmanager.com/gtag/js?id=G-VXGQBLEBHH"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-VXGQBLEBHH');
</script>`
},
{
match: /<!-- buy-me-coffee -->/g,
replacement: '<div class="text-center mt-8"><a href="https://www.buymeacoffee.com/pimenov"><img src="images/buy-me-coffee.png" alt="Buy me a coffee"></a></div>'
},
{
match: /<!-- umami -->/g,
replacement: `
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
<script>
window.addEventListener("load", () => {
setTimeout(()=>{
docsearch({
container: '#docsearch',
appId: '3YA8D73J2D',
indexName: 'metroui',
apiKey: '9f2ac6585d9604329a7a2263441047a1',
});
}, 1000)
})
</script>
`
// <script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3" onload="docsearch({appId: '90CHSLCJTV',apiKey: 'c0207161474ce182d44c10f16181304e',indexName: 'metroui-org',container: '#algolia-search',debug: false});"></script>
},
]
},
files: [
{
expand: true,
flatten: true,
src: ['build/*.html'], dest: 'build/'
}
]
}
}
});
grunt.registerTask('default', [
'clean',
'postcss',
'copy',
'replace'
]);
};