-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(flavor) fancy-templated-site v3.0.0
- Loading branch information
Showing
20 changed files
with
186 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.min.js | ||
*.build.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use strict'; | ||
|
||
const ChildProcess = require('child_process'); | ||
const Util = require('util'); | ||
|
||
module.exports = [ | ||
{ | ||
type: 'onPostStart', | ||
method: async (server) => { | ||
|
||
if (!server.realm.pluginOptions.developmentMode) { | ||
return; | ||
} | ||
|
||
const bs = server.app.bs = require('browser-sync').create(); | ||
const base = server.realm.settings.files.relativeTo; | ||
const run = (cmd) => ChildProcess.spawn('npm', ['run', cmd], { stdio: 'inherit' }); | ||
|
||
bs.watch(`${base}/public/**/*.scss`).on('change', () => run('prebuild:css')); | ||
bs.watch([`${base}/public/**/*.js`, '!**/*.build.*']).on('change', () => run('prebuild:js')); | ||
|
||
bs.watch(`${base}/templates/**/*`).on('change', bs.reload); | ||
bs.watch(`${base}/public/**/*.{build.js,css}`).on('change', bs.reload); | ||
|
||
await Util.promisify(bs.init)({ proxy: server.info.uri }); | ||
} | ||
}, | ||
{ | ||
type: 'onPreStop', | ||
method: (server) => { | ||
|
||
if (!server.app.bs) { | ||
return; | ||
} | ||
|
||
server.app.bs.exit(); | ||
} | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
module.exports = __dirname; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
module.exports = {}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
body{background-color:#000;color:#fff} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
body { | ||
color: white; | ||
background-color: black; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
console.log('Hello, pals!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
method: 'get', | ||
path: '/', | ||
handler: { | ||
view: { | ||
template: 'home' | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
method: 'get', | ||
path: '/public/{p*}', | ||
handler: { | ||
directory: { | ||
path: 'public' | ||
} | ||
} | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{#> layout title="Home" }} | ||
|
||
{{#*inline "content"}} | ||
Hello, pals! This is the homepage. | ||
{{/inline}} | ||
|
||
{{/layout}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>{{title}}</title> | ||
|
||
{{#if options.developmentMode}} | ||
<link rel="stylesheet" href="{{baseURI}}/public/css/main.build.css"> | ||
{{else}} | ||
<link rel="stylesheet" href="{{baseURI}}/public/css/main.build.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.build.js"></script> | ||
{{else}} | ||
<script src="{{baseURI}}/public/js/main.build.min.js"></script> | ||
{{/if}} | ||
|
||
{{#> scripts-block}} | ||
{{!-- Custom scripts per page can be added. --}} | ||
{{/scripts-block}} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 || '' | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters