-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.js
129 lines (127 loc) · 3.16 KB
/
page.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
module.exports = function(grunt){
process.removeAllListeners('warning');
require('dotenv').config();
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
var gc = {},
pkg = grunt.file.readJSON('package.json'),
path = require('path'),
uniqid = function () {
let result = URL.createObjectURL(new Blob([])).slice(-36).replace(/-/g, '');
return result;
};
function getTasks() {
switch(process.env.GRUNT_TASK){
default:
return [
'imagemin',
'less',
'cssmin',
'uglify',
'pug'
];
}
}
grunt.initConfig({
globalConfig : gc,
pkg : pkg,
imagemin: {
base: {
options: {
optimizationLevel: 3,
svgoPlugins: [
{
removeViewBox: false
}
]
},
files: [
{
expand: true,
flatten : true,
src: [
'page/images/*.{png,jpg,gif}'
],
dest: 'docs/images/',
filter: 'isFile'
}
],
}
},
less: {
main: {
options : {
compress: false,
ieCompat: false
},
files: {
'test/css/main.css': [
'page/less/main.less'
],
}
}
},
cssmin: {
options: {
mergeIntoShorthands: false,
roundingPrecision: -1
},
minify: {
files: {
'docs/css/main.css' : [
'test/css/main.css'
],
}
}
},
pug: {
files: {
options: {
pretty: '\t',
separator: '\n',
// https://projectsoft-studionions.github.io/FontMassivePackInstaller/
data: function(dest, src) {
return {
"hash": uniqid(),
"repo": "projectsoft-studionions.github.io",
"userName": "ProjectSoft-STUDIONIONS",
"page": "radioApp-lite",
"download": "YourRadioLightSetup.exe",
"title": "Your Radio Light | Ваше Радио (облегчённая версия) | ProjectSoft GitHub Pages",
"h1title": "Your Radio Light | Ваше Радио (облегчённая версия)",
"description": "Приложение для прослушивания радио на компьютере. В этом приложении пользователь будет сам управлять списком радиостанций, добавление, редактирование, удаление, экспорт списка со всеми надстройками и, соответственно, импорт.",
"keywords": "ProjectSoft, STUDIONIONS, ProjectSoft-STUDIONIONS, Your Radio Light, Ваше Радио (облегчённая версия), Ваше Радио",
"nickname": "ProjectSoft",
"logotype": "projectsoft.png",
"copyright": "2008 - all right reserved",
"open_graph": {
"image_16x9": "application.png",
"image_16x9_width": "499",
"image_16x9_height": "392",
"image_1x1": "application.png",
"image_1x1_width": "499",
"image_1x1_height": "392",
}
}
}
},
files: {
"docs/index.html": ['page/pug/index.pug'],
}
}
},
uglify : {
options: {
ASCIIOnly: true,
},
main: {
files: {
'test/js/main.js': [
'page/js/main.js'
]
}
},
},
});
grunt.registerTask('default', getTasks());
}