-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Handlebars helpers
assign
, partial
and block
to exten…
…d a template layout with blocks
- Loading branch information
Showing
68 changed files
with
1,389 additions
and
116 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# Ignore all HTML files in test directory: | ||
test/cases/**/*.html | ||
test/cases/**/*.hbs |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Using assign, blocks and layouts in Handlebars | ||
|
||
Using the `partial` and `block` build-in plugin helpers you can extend a template layout the many blocks. | ||
You can assign many variables, which will be available in a partial. | ||
|
||
Use the [HTML Builder Plugin](https://github.com/webdiscus/html-bundler-webpack-plugin) for Webpack | ||
to compile and bundle source Sass and JavaScript in template. | ||
|
||
## View and edit in browser | ||
|
||
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/webpack-webpack-js-org-bjtjvc?file=webpack.config.js) | ||
|
||
## How to use | ||
|
||
```sh | ||
git clone https://github.com/webdiscus/html-bundler-webpack-plugin.git | ||
cd examples/handlebars-layout/ | ||
npm install | ||
npm start | ||
``` |
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,25 @@ | ||
{ | ||
"name": "handlebars-layout", | ||
"description": "Extend layout template with blocks.", | ||
"version": "0.0.1", | ||
"repository": "webdiscus/html-bundler-webpack-plugin", | ||
"license": "ISC", | ||
"stackblitz": { | ||
"startCommand": "npm start" | ||
}, | ||
"scripts": { | ||
"start": "webpack serve", | ||
"build": "webpack build --mode=production", | ||
"test": "npm run build" | ||
}, | ||
"devDependencies": { | ||
"css-loader": "^6.8.1", | ||
"handlebars": "^4.7.8", | ||
"html-bundler-webpack-plugin": "^2.10.0", | ||
"sass": "^1.64.2", | ||
"sass-loader": "^13.3.2", | ||
"webpack": "^5.88.2", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-dev-server": "^4.15.1" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
console.log('>> main'); |
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 @@ | ||
body { | ||
font-family: 'OpenSans', sans-serif; | ||
margin: 0; | ||
} | ||
|
||
h1 { | ||
color: #f0772b; | ||
} | ||
|
||
.custom { | ||
font-style: italic; | ||
color: #9fa9af; | ||
text-align: center; | ||
} | ||
|
||
.nav { | ||
padding: 10px 20px; | ||
text-align: center; | ||
} | ||
|
||
.header { | ||
padding: 20px 0; | ||
text-align: center; | ||
color: #351704; | ||
background-color: #ffddaa; | ||
} | ||
|
||
.footer { | ||
padding: 10px 0; | ||
text-align: center; | ||
color: white; | ||
background-color: #f0772b; | ||
} | ||
|
||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} |
Oops, something went wrong.