1
Fork 0

FIx syntax issue with parcel and handlebars

This commit is contained in:
Jake Howard 2019-06-29 20:44:48 +01:00
parent 7d30d1900a
commit 81f61ccefd
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 26 additions and 25 deletions

View file

@ -66,10 +66,10 @@ function writeTemplate(
statusOutput('Creating template'); statusOutput('Creating template');
const bundler = new Bundler(join(SRC_DIR, 'template.html'), BUNDLER_OPTIONS); const bundler = new Bundler(join(SRC_DIR, 'template.html'), BUNDLER_OPTIONS);
console.log((bundler as any));
await bundler.bundle(); await bundler.bundle();
statusOutput('Compiling HTML template'); statusOutput('Compiling HTML template');
Handlebars.registerPartial('accounts', readFileSync(join(SRC_DIR, 'accounts.html')).toString());
const template = Handlebars.compile( const template = Handlebars.compile(
readFileSync(join(BUILD_DIR, 'template.html')).toString() readFileSync(join(BUILD_DIR, 'template.html')).toString()
); );

13
src/accounts.html Normal file
View file

@ -0,0 +1,13 @@
<div class="jumbotron mb-0 jumbotron-fluid">
<div class="container">
<div class="card-deck">
{{#each accounts }}
<div class="card text-center mx-5">
<a href="{{ link }}" class="colour-invert">
<img src="{{ image }}" class="card-img-top my-3 mx-3" alt="{{ name }} logo" style="max-width:40%" />
</a>
</div>
{{/each}}
</div>
</div>
</div>

View file

@ -1,9 +1,9 @@
<html> <html>
<head> <head>
<link rel="stylesheet" href="../node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss" /> <link rel="stylesheet" href="../node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss" />
<link rel="stylesheet" href="../node_modules/animate.css/animate.min.css" /> <link rel="stylesheet" href="../node_modules/animate.css/animate.min.css" />
<link rel="stylesheet" href="./index.scss" /> <link rel="stylesheet" href="./index.scss" />
</head> </head>
<body> <body>
<div class="jumbotron mb-0 jumbotron-fluid text-center vertical-center"> <div class="jumbotron mb-0 jumbotron-fluid text-center vertical-center">
<div class="container"> <div class="container">
@ -15,19 +15,7 @@
</div> </div>
</div> </div>
<div class="jumbotron mb-0 jumbotron-fluid"> {{> accounts }}
<div class="container">
<div class="card-deck">
{{#list accounts }}
<div class="card text-center mx-5">
<a href="{{ link }}" class="colour-invert">
<img src="{{ image }}" class="card-img-top my-3 mx-3" alt="{{ name }} logo" style="max-width:40%" />
</a>
</div>
{{/list}}
</div>
</div>
</div>
<script type="text/javascript" src="../node_modules/bootstrap/js/src/index.js"></script> <script type="text/javascript" src="../node_modules/bootstrap/js/src/index.js"></script>
</body> </body>