Permalink
Browse files

(flavor) templated-site v2.2.0

  • Loading branch information...
devinivy committed Dec 16, 2018
1 parent 8e24c92 commit 79c857848488a41e0dbf2acfe717de09c92d2d03
@@ -0,0 +1,2 @@
*.min.js
*.build.js
@@ -0,0 +1,3 @@
'use strict';

module.exports = __dirname;
@@ -0,0 +1,3 @@
'use strict';

module.exports = {};
@@ -0,0 +1,3 @@
'use strict';

module.exports = {};
@@ -0,0 +1,4 @@
body {
color: white;
background-color: black;
}
@@ -0,0 +1 @@
body{background-color:#000;color:#fff}
@@ -0,0 +1,3 @@
'use strict';

console.log('Hello, pals!');
@@ -0,0 +1 @@
"use strict";console.log("Hello, pals!");
@@ -0,0 +1,11 @@
'use strict';

module.exports = {
method: 'get',
path: '/',
handler: {
view: {
template: 'home'
}
}
};
@@ -0,0 +1,11 @@
'use strict';

module.exports = {
method: 'get',
path: '/public/{p*}',
handler: {
directory: {
path: 'public'
}
}
};
File renamed without changes.
@@ -0,0 +1,7 @@
{{#> layout title="Home" }}

{{#*inline "content"}}
Hello, pals! This is the homepage.
{{/inline}}

{{/layout}}
@@ -0,0 +1,32 @@
<!doctype html>
<html>
<head>
<title>{{title}}</title>

{{#if options.developmentMode}}
<link rel="stylesheet" href="{{baseURI}}/public/css/main.css">
{{else}}
<link rel="stylesheet" href="{{baseURI}}/public/css/main.min.css">
{{/if}}

{{#> head-block}}
{{!-- Custom <head> content per page could be added. --}}
{{/head-block}}
</head>

<body>
{{#> content}}
{{!-- Content goes here. --}}
{{/content}}

{{#if options.developmentMode}}
<script src="{{baseURI}}/public/js/main.js"></script>
{{else}}
<script src="{{baseURI}}/public/js/main.min.js"></script>
{{/if}}

{{#> scripts-block}}
{{!-- Custom scripts per page can be added. --}}
{{/scripts-block}}
</body>
</html>
@@ -0,0 +1,18 @@
'use strict';

const Handlebars = require('handlebars');

module.exports = (server, options) => ({
path: 'templates',
partialsPath: 'templates/partials',
helpersPath: 'templates/helpers',
isCached: !options.developmentMode,
defaultExtension: 'hbs',
engines: {
hbs: Handlebars
},
context: {
options,
baseURI: server.realm.modifiers.route.prefix || ''
}
});
@@ -5,15 +5,22 @@
"scripts": {
"start": "node server",
"test": "lab -a code -L",
"lint": "eslint ."
"lint": "eslint .",
"build:css": "postcss lib/public/css/main.css -o lib/public/css/main.min.css --use cssnano --no-map",
"build:js": "uglifyjs lib/public/js/main.js -o lib/public/js/main.min.js",
"build": "npm run build:css && npm run build:js"
},
"dependencies": {
"boom": "7.x.x",
"handlebars": "4.x.x",
"haute-couture": "3.x.x",
"joi": "14.x.x"
"inert": "5.x.x",
"joi": "14.x.x",
"vision": "5.x.x"
},
"devDependencies": {
"code": "5.x.x",
"cssnano": "4.x.x",
"confidence": "4.x.x",
"dotenv": "6.x.x",
"eslint": "5.x.x",
@@ -23,6 +30,9 @@
"hapi": "17.x.x",
"hpal-debug": "1.x.x",
"lab": "18.x.x",
"toys": "2.x.x"
"postcss": "7.x.x",
"postcss-cli": "6.x.x",
"toys": "2.x.x",
"uglify-js": "3.x.x"
}
}
@@ -31,7 +31,13 @@ module.exports = new Confidence.Store({
plugins: [
{
plugin: '../lib', // Main plugin
options: {}
options: {
developmentMode: {
$filter: { $env: 'NODE_ENV' },
$default: true,
production: false
}
}
},
{
plugin: {

0 comments on commit 79c8578

Please sign in to comment.