Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ericf/express-handlebars
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.2
Choose a base ref
...
head repository: ericf/express-handlebars
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 10 commits
  • 5 files changed
  • 3 contributors

Commits on Apr 13, 2019

  1. Copy the full SHA
    d489794 View commit details

Commits on May 8, 2019

  1. Copy the full SHA
    489e8d8 View commit details

Commits on May 14, 2019

  1. Update server.js

    jfbrennan authored May 14, 2019
    Copy the full SHA
    cf09e20 View commit details
  2. Update server.js

    jfbrennan authored May 14, 2019
    Copy the full SHA
    ebbb003 View commit details
  3. Update README.md

    jfbrennan authored May 14, 2019
    Copy the full SHA
    3334f4f View commit details
  4. Update README.md

    jfbrennan authored May 14, 2019
    Copy the full SHA
    e7e1194 View commit details
  5. Update README.md

    jfbrennan authored May 14, 2019
    Copy the full SHA
    87f7c11 View commit details
  6. Merge pull request #249 from jfbrennan/master

    Provide default for defaultLayout
    sahat authored May 14, 2019
    Copy the full SHA
    eac8710 View commit details
  7. bump handlebars to 4.1.2 to fix vulnerability issue

    Sahat Yalkabov committed May 14, 2019
    Copy the full SHA
    588646f View commit details
  8. v3.1.0

    Sahat Yalkabov committed May 14, 2019
    Copy the full SHA
    5729018 View commit details
Showing with 6 additions and 7 deletions.
  1. +2 −2 README.md
  2. +0 −1 examples/advanced/server.js
  3. +1 −1 examples/basic/server.js
  4. +1 −1 lib/express-handlebars.js
  5. +2 −2 package.json
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ var exphbs = require('express-handlebars');

var app = express();

app.engine('handlebars', exphbs({defaultLayout: 'main'}));
app.engine('handlebars', exphbs());
app.set('view engine', 'handlebars');

app.get('/', function (req, res) {
@@ -356,7 +356,7 @@ The string path to the directory where the partials templates reside or object w
**Note:** Multiple partials dirs can be used by making `partialsDir` an array of strings, and/or config objects as described above. The namespacing feature is useful if multiple partials dirs are used and their file paths might clash.

#### `defaultLayout`
The string name or path of a template in the `layoutsDir` to use as the default layout. This is overridden by a `layout` specified in the app or response `locals`. **Note:** A falsy value will render without a layout; e.g., `res.render('home', {layout: false});`.
The string name or path of a template in the `layoutsDir` to use as the default layout. `main` is used as the default. This is overridden by a `layout` specified in the app or response `locals`. **Note:** A falsy value will render without a layout; e.g., `res.render('home', {layout: false});`.

#### `helpers`
An object which holds the helper functions used when rendering templates with this `ExpressHandlebars` instance. When rendering a template, a collection of helpers will be generated by merging: `handlebars.helpers` (global), `helpers` (instance), and `options.helpers` (render-level). This allows Handlebars' `registerHelper()` function to operate as expected, will providing two extra levels over helper overrides.
1 change: 0 additions & 1 deletion examples/advanced/server.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ var app = express();

// Create `ExpressHandlebars` instance with a default layout.
var hbs = exphbs.create({
defaultLayout: 'main',
helpers : helpers,

// Uses multiple partials dirs, templates in "shared/templates/" are shared
2 changes: 1 addition & 1 deletion examples/basic/server.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ var express = require('express'),

var app = express();

app.engine('handlebars', exphbs({defaultLayout: 'main'}));
app.engine('handlebars', exphbs());
app.set('view engine', 'handlebars');

app.get('/', function (req, res) {
2 changes: 1 addition & 1 deletion lib/express-handlebars.js
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ function ExpressHandlebars(config) {
extname : '.handlebars',
layoutsDir : undefined, // Default layouts directory is relative to `express settings.view` + `layouts/`
partialsDir : undefined, // Default partials directory is relative to `express settings.view` + `partials/`
defaultLayout : undefined,
defaultLayout : 'main',
helpers : undefined,
compilerOptions: undefined,
}, config);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "express-handlebars",
"description": "A Handlebars view engine for Express which doesn't suck.",
"version": "3.0.2",
"version": "3.1.0",
"homepage": "https://github.com/ericf/express-handlebars",
"keywords": [
"express",
@@ -26,7 +26,7 @@
"dependencies": {
"glob": "^7.1.3",
"graceful-fs": "^4.1.2",
"handlebars": "^4.0.13",
"handlebars": "^4.1.2",
"object.assign": "^4.1.0",
"promise": "^8.0.2"
},