mirror of
https://github.com/daledavies/jump.git
synced 2026-02-25 15:50:45 +01:00
Fix issue #42: Use template partial for dynamic elements
This commit is contained in:
@@ -33,6 +33,6 @@
|
||||
{{/ hastags}}
|
||||
<span class="unsplash"></span>
|
||||
<div class="background fixed"></div>
|
||||
<script defer src="{{{wwwurl}}}/assets/js/index.068ef33aa2ef2fcb48cf.min.js"></script>
|
||||
{{> partials/jsbundle}}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{{# noindex}}<meta name="robots" content="noindex">{{/ noindex}}
|
||||
{{# unsplashcolor}}<meta name="theme-color" content="{{unsplashcolor}}">{{/ unsplashcolor}}
|
||||
<link rel="stylesheet" href="{{{wwwurl}}}/assets/css/styles.efdc3d1d099422476385.min.css">
|
||||
{{> partials/cssbundle}}
|
||||
<link rel="stylesheet" href="{{{wwwurl}}}/background-css.php">
|
||||
<link rel="stylesheet" href="{{{wwwurl}}}/assets/css/weather-icons.min.css">
|
||||
<link rel="icon" type="image/png" href="{{{wwwurl}}}/favicon.png">
|
||||
|
||||
1
jumpapp/templates/partials/cssbundle.mustache
Normal file
1
jumpapp/templates/partials/cssbundle.mustache
Normal file
@@ -0,0 +1 @@
|
||||
<link rel="stylesheet" href="{{{wwwurl}}}/assets/css/styles.efdc3d1d099422476385.min.css">
|
||||
1
jumpapp/templates/partials/jsbundle.mustache
Normal file
1
jumpapp/templates/partials/jsbundle.mustache
Normal file
@@ -0,0 +1 @@
|
||||
<script defer src="{{{wwwurl}}}/assets/js/index.4a527886f69a6042160d.min.js"></script>
|
||||
1
jumpapp/templates/partials/src/cssbundle.src.mustache
Normal file
1
jumpapp/templates/partials/src/cssbundle.src.mustache
Normal file
@@ -0,0 +1 @@
|
||||
<link rel="stylesheet" href="{{{wwwurl}}}/assets/css/<%= _.last(htmlWebpackPlugin.files.css[0].split('/')) %>">
|
||||
1
jumpapp/templates/partials/src/jsbundle.src.mustache
Normal file
1
jumpapp/templates/partials/src/jsbundle.src.mustache
Normal file
@@ -0,0 +1 @@
|
||||
<script defer src="{{{wwwurl}}}/assets/js/<%= _.last(htmlWebpackPlugin.files.js[0].split('/')) %>"></script>
|
||||
@@ -1,38 +0,0 @@
|
||||
</div>
|
||||
<span class="time-weather hidden">
|
||||
<a class="weather widget clickable" href="https://openweathermap.org/">
|
||||
<span class="weather-info">
|
||||
<span class="desc"></span>
|
||||
<span class="temp"></span>
|
||||
</span>
|
||||
<i class="weather-icon wi"></i>
|
||||
</a>
|
||||
{{# showclock}}<span class="time widget"></span>{{/ showclock}}
|
||||
</span>
|
||||
<span class="useclientlocation widget clickable"></span>
|
||||
<div class="header-bar">
|
||||
{{# showsearch}}
|
||||
<span class="search">
|
||||
<span class="close"></span>
|
||||
<form class="search-form">
|
||||
<input type="search">
|
||||
</form>
|
||||
<span class="suggestion-list"></span>
|
||||
</span>
|
||||
{{/ showsearch}}
|
||||
{{# hastags }}<a href="#tags" class="show-tags"></a>{{/ hastags }}
|
||||
</div>
|
||||
{{# hastags}}
|
||||
<div id="tags" class="tags">
|
||||
<span class="header">Tags<span class="close"></span></span>
|
||||
<ul>
|
||||
<li><a href="{{{wwwurl}}}/">home</a></li>
|
||||
{{# tags}}<li><a href="{{{wwwurl}}}/tag/{{.}}/">{{.}}</a></li>{{/ tags}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/ hastags}}
|
||||
<span class="unsplash"></span>
|
||||
<div class="background fixed"></div>
|
||||
<script defer src="{{{wwwurl}}}/assets/js/<%= _.last(htmlWebpackPlugin.files.js[0].split('/')) %>"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,33 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{{# noindex}}<meta name="robots" content="noindex">{{/ noindex}}
|
||||
{{# unsplashcolor}}<meta name="theme-color" content="{{unsplashcolor}}">{{/ unsplashcolor}}
|
||||
<link rel="stylesheet" href="{{{wwwurl}}}/assets/css/<%= _.last(htmlWebpackPlugin.files.css[0].split('/')) %>">
|
||||
<link rel="stylesheet" href="{{{wwwurl}}}/background-css.php">
|
||||
<link rel="stylesheet" href="{{{wwwurl}}}/assets/css/weather-icons.min.css">
|
||||
<link rel="icon" type="image/png" href="{{{wwwurl}}}/favicon.png">
|
||||
<title>{{title}}</title>
|
||||
<script>
|
||||
const JUMP = {
|
||||
owmapikey: '{{owmapikey}}',
|
||||
metrictemp: '{{metrictemp}}',
|
||||
ampmclock: '{{ampmclock}}',
|
||||
token: '{{csrftoken}}',
|
||||
search: '{{{searchjson}}}',
|
||||
searchengines: '{{{searchengines}}}',
|
||||
unsplash: '{{{unsplash}}}',
|
||||
unsplashcolor: '{{unsplashcolor}}',
|
||||
wwwurl: '{{{wwwurl}}}'
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content fixed hidden">
|
||||
<div class="greeting">
|
||||
{{# greeting}}<span class="tagname"><span>#</span>{{greeting}}</span>{{/ greeting}}
|
||||
{{^ greeting}}Good <span class="chosen"></span>{{/ greeting}}
|
||||
</div>
|
||||
|
||||
@@ -42,16 +42,16 @@ module.exports = {
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
filename: path.resolve(__dirname, './jumpapp/templates/header.mustache'),
|
||||
template: path.resolve(__dirname, './jumpapp/templates/src/header.src.mustache'),
|
||||
filename: path.resolve(__dirname, './jumpapp/templates/partials/cssbundle.mustache'),
|
||||
template: path.resolve(__dirname, './jumpapp/templates/partials/src/cssbundle.src.mustache'),
|
||||
inject: false,
|
||||
minify: false, // Required to prevent addition of closing tags like body and html.
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
filename: path.resolve(__dirname, './jumpapp/templates/footer.mustache'),
|
||||
template: path.resolve(__dirname, './jumpapp/templates/src/footer.src.mustache'),
|
||||
filename: path.resolve(__dirname, './jumpapp/templates/partials/jsbundle.mustache'),
|
||||
template: path.resolve(__dirname, './jumpapp/templates/partials/src/jsbundle.src.mustache'),
|
||||
inject: false,
|
||||
minify: false, // Required to prevent addition of closing tags like body and html.
|
||||
minify: false,
|
||||
}),
|
||||
new MiniCssExtractPlugin({filename: '../css/[name].[contenthash].min.css'}),
|
||||
new RemoveEmptyScriptsPlugin(),
|
||||
|
||||
Reference in New Issue
Block a user