From 32c14b4715c8182e41266fb44ea501c95b5d172d Mon Sep 17 00:00:00 2001 From: VikramSingh-vartagram Date: Tue, 13 Jan 2026 06:04:29 +0530 Subject: [PATCH 1/6] docs: add manual setup guide for handlebars --- en/guide/using-template-engines.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/en/guide/using-template-engines.md b/en/guide/using-template-engines.md index 9921ce5b7a..0b81f0d525 100755 --- a/en/guide/using-template-engines.md +++ b/en/guide/using-template-engines.md @@ -21,6 +21,20 @@ To render template files, set the following [application setting properties](/{{ This defaults to the `views` directory in the application root directory. * `view engine`, the template engine to use. For example, to use the Pug template engine: `app.set('view engine', 'pug')`. +### Manual Setup (Without Generator) ++ ++ If you are not using the Express generator, you must manually configure the engine to ensure Express can interface with it properly. While engines like Pug work out of the box, others (like Handlebars) require a specific wrapper package. ++ ++ For example, to use Handlebars manually: ++ 1. Install the `express-handlebars` package: `$ npm install express-handlebars` ++ 2. Configure it in your `app.js`: ++ ++ ```js ++ const { engine } = require('express-handlebars'); ++ app.engine('handlebars', engine()); ++ app.set('view engine', 'handlebars'); ++ ``` + Then install the corresponding template engine npm package; for example to install Pug: ```bash From da6c492edae344a400b437a955d760274ad2cca9 Mon Sep 17 00:00:00 2001 From: VikramSingh-vartagram Date: Tue, 13 Jan 2026 06:12:37 +0530 Subject: [PATCH 2/6] fix: resolve linting issue --- en/guide/using-template-engines.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/en/guide/using-template-engines.md b/en/guide/using-template-engines.md index 0b81f0d525..c507f8ee63 100755 --- a/en/guide/using-template-engines.md +++ b/en/guide/using-template-engines.md @@ -20,7 +20,6 @@ To render template files, set the following [application setting properties](/{{ * `views`, the directory where the template files are located. Eg: `app.set('views', './views')`. This defaults to the `views` directory in the application root directory. * `view engine`, the template engine to use. For example, to use the Pug template engine: `app.set('view engine', 'pug')`. - ### Manual Setup (Without Generator) + + If you are not using the Express generator, you must manually configure the engine to ensure Express can interface with it properly. While engines like Pug work out of the box, others (like Handlebars) require a specific wrapper package. @@ -34,7 +33,6 @@ This defaults to the `views` directory in the application root directory. + app.engine('handlebars', engine()); + app.set('view engine', 'handlebars'); + ``` - Then install the corresponding template engine npm package; for example to install Pug: ```bash From 6b88101943be4c01614ca2434f3f9bf5a71ae994 Mon Sep 17 00:00:00 2001 From: VikramSingh-vartagram Date: Tue, 13 Jan 2026 06:20:55 +0530 Subject: [PATCH 3/6] docs: fix broken code block and spacing syntax --- en/guide/using-template-engines.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/en/guide/using-template-engines.md b/en/guide/using-template-engines.md index c507f8ee63..98ad2eed9d 100755 --- a/en/guide/using-template-engines.md +++ b/en/guide/using-template-engines.md @@ -20,19 +20,20 @@ To render template files, set the following [application setting properties](/{{ * `views`, the directory where the template files are located. Eg: `app.set('views', './views')`. This defaults to the `views` directory in the application root directory. * `view engine`, the template engine to use. For example, to use the Pug template engine: `app.set('view engine', 'pug')`. + ### Manual Setup (Without Generator) -+ -+ If you are not using the Express generator, you must manually configure the engine to ensure Express can interface with it properly. While engines like Pug work out of the box, others (like Handlebars) require a specific wrapper package. -+ -+ For example, to use Handlebars manually: -+ 1. Install the `express-handlebars` package: `$ npm install express-handlebars` -+ 2. Configure it in your `app.js`: -+ -+ ```js -+ const { engine } = require('express-handlebars'); -+ app.engine('handlebars', engine()); -+ app.set('view engine', 'handlebars'); -+ ``` + +If you are not using the Express generator, you must manually configure the engine to ensure Express can interface with it properly. While engines like Pug work out of the box, others (like Handlebars) require a specific wrapper package. + +For example, to use Handlebars manually: + +1. Install the `express-handlebars` package: `$ npm install express-handlebars` +2. Configure it in your `app.js`: + +```js +const { engine } = require('express-handlebars'); +app.engine('handlebars', engine()); +app.set('view engine', 'handlebars'); Then install the corresponding template engine npm package; for example to install Pug: ```bash From bf45af28f00263b0bd6309e6f604678f6ec71964 Mon Sep 17 00:00:00 2001 From: VikramSingh-vartagram Date: Tue, 13 Jan 2026 06:33:21 +0530 Subject: [PATCH 4/6] docs: fix spacing syntax 2 --- en/guide/using-template-engines.md | 1 - 1 file changed, 1 deletion(-) diff --git a/en/guide/using-template-engines.md b/en/guide/using-template-engines.md index 98ad2eed9d..d1651afe36 100755 --- a/en/guide/using-template-engines.md +++ b/en/guide/using-template-engines.md @@ -22,7 +22,6 @@ This defaults to the `views` directory in the application root directory. * `view engine`, the template engine to use. For example, to use the Pug template engine: `app.set('view engine', 'pug')`. ### Manual Setup (Without Generator) - If you are not using the Express generator, you must manually configure the engine to ensure Express can interface with it properly. While engines like Pug work out of the box, others (like Handlebars) require a specific wrapper package. For example, to use Handlebars manually: From ab392a41eb43633fe51808bae1d7ded7217fdaf2 Mon Sep 17 00:00:00 2001 From: VikramSingh-vartagram Date: Tue, 13 Jan 2026 06:44:46 +0530 Subject: [PATCH 5/6] docs: fix parsing and spacing syntax --- en/guide/using-template-engines.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/en/guide/using-template-engines.md b/en/guide/using-template-engines.md index d1651afe36..e94a61ef59 100755 --- a/en/guide/using-template-engines.md +++ b/en/guide/using-template-engines.md @@ -22,6 +22,7 @@ This defaults to the `views` directory in the application root directory. * `view engine`, the template engine to use. For example, to use the Pug template engine: `app.set('view engine', 'pug')`. ### Manual Setup (Without Generator) + If you are not using the Express generator, you must manually configure the engine to ensure Express can interface with it properly. While engines like Pug work out of the box, others (like Handlebars) require a specific wrapper package. For example, to use Handlebars manually: @@ -33,6 +34,7 @@ For example, to use Handlebars manually: const { engine } = require('express-handlebars'); app.engine('handlebars', engine()); app.set('view engine', 'handlebars'); +``` Then install the corresponding template engine npm package; for example to install Pug: ```bash From 5a7fbd362b045a4969cdd3bfc4a3a6c244998871 Mon Sep 17 00:00:00 2001 From: VikramSingh-vartagram Date: Tue, 13 Jan 2026 06:46:47 +0530 Subject: [PATCH 6/6] docs: fix extra semi-colon issue --- en/guide/using-template-engines.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/en/guide/using-template-engines.md b/en/guide/using-template-engines.md index e94a61ef59..5fcd7ae166 100755 --- a/en/guide/using-template-engines.md +++ b/en/guide/using-template-engines.md @@ -31,9 +31,9 @@ For example, to use Handlebars manually: 2. Configure it in your `app.js`: ```js -const { engine } = require('express-handlebars'); -app.engine('handlebars', engine()); -app.set('view engine', 'handlebars'); +const { engine } = require('express-handlebars') +app.engine('handlebars', engine()) +app.set('view engine', 'handlebars') ``` Then install the corresponding template engine npm package; for example to install Pug: