forked from Dynalon/mdwiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tmpl
138 lines (123 loc) · 4.38 KB
/
index.tmpl
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
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html>
<!--
This is <%= grunt.config('pkg').name %> v<%= grunt.config('pkg').version %>
(C) 2013 by Timo Dörr and contributors. This software is licensed
under the terms of the GNU GPLv3 with additional terms applied.
See https://github.com/Dynalon/mdwiki/blob/master/LICENSE.txt for more detail.
See http://github.com/Dynalon/mdwiki for a copy of the source code.
-->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="fragment" content="!">
<style type="text/css">
.md-hidden-load { display: none; }
/* for pageContentMenu */
#md-page-menu {
position: static;
}
#md-page-menu a.active {
/* background-color: rgba(0, 0, 0, 0.01); */
font-weight: bold;
padding-left: 6px;
}
@media (min-width: 992px) {
#md-page-menu.affix {
position: fixed;
}
}
@media (min-width: 768px) {
}
@media (max-width: 992px) {
a.forkmeongithub {
display: none;
}
}
</style>
<%
var task = grunt.config('currentTask').name;
grunt.log.writeln('Building single index.html of type: ' + task);
var ownJsFileFull = grunt.config('concat').dev.dest;
var ownJsFileMin = grunt.config('uglify').dist.dest;
var internalJsFiles = grunt.config('internalJsFiles');
var internalCssFiles = grunt.config('internalCssFiles');
var externalJsFiles = grunt.config('externalJsFiles');
var externalCssFiles = grunt.config('externalCssFiles');
var externalJsRefs = grunt.config('externalJsRefs');
var externalCssRefs = grunt.config('externalCssRefs');
function print_script_ref(ref) {
print('<script type="text/javascript" src="//' + ref + '"></script>\n');
}
function print_style_ref(ref) {
print('<link rel="stylesheet" href="//' + ref + '" type="text/css"></link>\n');
}
function print_script_inline(name, content) {
print('<!-- START ' + name + ' -->\n');
print('<script type="text/javascript">');
print(content);
print('</script>\n');
print('<!-- END ' + name + ' -->\n');
}
function print_style_inline(name, content) {
print('<!-- START ' + name + ' -->\n');
print('<style id="style:' + name + '">');
print(content);
print('</style>');
print('<!-- END ' + name + ' -->\n');
}
if (task === 'slim') {
// INCLUDE REFERENCES TO CDN
// css
for(var i = 0, len = externalCssRefs.length; i < len; i++) {
print_style_ref(externalCssRefs[i]);
}
// js
for(var i = 0, len = externalJsRefs.length; i < len; i++) {
print_script_ref(externalJsRefs[i]);
}
}
else if (task === 'fat' || task ==='devel') {
// INLINE SCRIPTS AND CSS
for(var i = 0, len = externalCssFiles.length; i < len; i++) {
var fileContent = grunt.file.read(externalCssFiles[i]);
print_style_inline(externalCssFiles[i], fileContent);
}
for(var i = 0, len = externalJsFiles.length; i < len; i++) {
var fileContent = grunt.file.read(externalJsFiles[i]);
print_script_inline(externalJsFiles[i], fileContent);
}
}
// STUFF WE ALWAYS INLINE (not available on any CDN)
for(var i = 0, len = internalCssFiles.length; i < len; i++) {
var fileContent = grunt.file.read(internalCssFiles[i]);
print_style_inline(internalCssFiles[i], fileContent);
}
for(var i = 0, len = internalJsFiles.length; i < len; i++) {
var fileContent = grunt.file.read(internalJsFiles[i]);
print_script_inline(internalJsFiles[i], fileContent);
}
// OUR OWN CODE
var fileContent = '';
if (task === 'devel') {
fileContent = grunt.file.read(ownJsFileFull);
print_script_inline(ownJsFileFull, fileContent);
} else if (task === 'fat' || task === 'slim') {
fileContent = grunt.file.read(ownJsFileMin);
print_script_inline(ownJsFileMin, fileContent);
}
%>
</head>
<body>
<noscript>
This website requires Javascript to be enabled. Please turn on Javascript
and reload the page.
</noscript>
<div id="md-all">
<div id="md-body">
<div id="md-title"></div>
<div id="md-menu"> </div>
<div id="md-content"></div>
</div>
</div>
</body>
</html>