Skip to content

Commit 42444a1

Browse files
author
Tobias Kiertscher
committed
fixed conditional noFrame class in div#frame
1 parent 10bc966 commit 42444a1

6 files changed

+17
-10
lines changed

assets/template.default.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$header-includes$
1717
</head>
1818
<body>
19-
<div id="frame" $if(toc)$$else$="" class="no-toc" $endif$="">
19+
<div id="frame"$if(toc)$$else$ class="no-toc"$endif$>
2020
<header>
2121
$include-before$
2222
<h1 id="title">$title$</h1>
@@ -62,4 +62,4 @@ <h1 id="title">$title$</h1>
6262
</footer>$endif$
6363
</div>
6464
</body>
65-
</html>
65+
</html>

assets/template.metro.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$header-includes$
1717
</head>
1818
<body>
19-
<div id="frame" $if(toc)$$else$="" class="no-toc" $endif$="">
19+
<div id="frame"$if(toc)$$else$ class="no-toc"$endif$>
2020
<header>
2121
$include-before$
2222
<h1 id="title">$title$</h1>
@@ -62,4 +62,4 @@ <h1 id="title">$title$</h1>
6262
</footer>$endif$
6363
</div>
6464
</body>
65-
</html>
65+
</html>

assets/template.roboto.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$header-includes$
1717
</head>
1818
<body>
19-
<div id="frame" $if(toc)$$else$="" class="no-toc" $endif$="">
19+
<div id="frame"$if(toc)$$else$ class="no-toc"$endif$>
2020
<header>
2121
$include-before$
2222
<h1 id="title">$title$</h1>
@@ -62,4 +62,4 @@ <h1 id="title">$title$</h1>
6262
</footer>$endif$
6363
</div>
6464
</body>
65-
</html>
65+
</html>

assets/template.science.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$header-includes$
1717
</head>
1818
<body>
19-
<div id="frame" $if(toc)$$else$="" class="no-toc" $endif$="">
19+
<div id="frame"$if(toc)$$else$ class="no-toc"$endif$>
2020
<header>
2121
$include-before$
2222
<h1 id="title">$title$</h1>
@@ -62,4 +62,4 @@ <h1 id="title">$title$</h1>
6262
</footer>$endif$
6363
</div>
6464
</body>
65-
</html>
65+
</html>

gulpfile.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,14 @@ var setTemplateStyle = function (html, opts) {
3434

3535
var insertLangAttribute = function (html) {
3636
'use strict';
37-
return html.replace('<html>', '<html$if(lang)$ lang="$lang$"$endif$>');
37+
return html.replace('<html>', '<html$$if(lang)$$ lang="$$lang$$"$$endif$$>');
3838
};
3939

40+
var insertNoFrameClass = function (html) {
41+
'use strict';
42+
return html.replace('<div id="frame">', '<div id="frame"$$if(toc)$$$$else$$ class="no-toc"$$endif$$>');
43+
}
44+
4045
gulp.task('clean', function () {
4146
'use strict';
4247
return del([tempDir + '**']);
@@ -74,10 +79,12 @@ gulp.task('build_html_template', function () {
7479
return merge(findStyles().map(function (style) {
7580
var styleSetter = textTransformation(setTemplateStyle, { style: style });
7681
var langInserter = textTransformation(insertLangAttribute);
82+
var noFrameInserter = textTransformation(insertNoFrameClass);
7783
return gulp.src('template.html', { cwd: tempDir })
7884
.pipe(styleSetter())
7985
.pipe(htinliner())
8086
.pipe(langInserter())
87+
.pipe(noFrameInserter())
8188
.pipe(rename('template.' + style + '.html'))
8289
.pipe(gulp.dest('assets/'));
8390
}));

src/template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
$header-includes$
1515
</head>
1616
<body>
17-
<div id="frame"$if(toc)$$else$ class="no-toc"$endif$>
17+
<div id="frame">
1818
<header>
1919
$include-before$
2020
<h1 id="title">$title$</h1>

0 commit comments

Comments
 (0)