From 50532a4a7b5d44a0cd13c0eea187cdc517a115b6 Mon Sep 17 00:00:00 2001 From: Arturo Riveron Borodovisina Date: Fri, 22 Oct 2021 11:39:02 -0500 Subject: [PATCH 1/2] fix(readme): fix include logic using ejs templates --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a09351bd..24151a7a 100644 --- a/README.md +++ b/README.md @@ -149,9 +149,9 @@ const resolve = require('path').resolve ``` and in ejs template files (for example templates/index.ejs) use something like: ```html -<% include header.ejs %> +<%- include('header.ejs') %> ``` -with a path relative to the current page, or an absolute path. +with a path relative to the current page, or an absolute path. Please check this example [here](https://raw.githubusercontent.com/fastify/point-of-view/c7ff7775cbc8dcf1a7194a517efbf243a74bd0be/templates/layout-with-includes.ejs) To use partials in mustache you will need to pass the names and paths in the options parameter: ```js From b3110ce2d7642526fa7a83af839f44975bfd2f8b Mon Sep 17 00:00:00 2001 From: Arturo Riveron Borodovisina Date: Fri, 22 Oct 2021 15:57:29 -0500 Subject: [PATCH 2/2] fix(readme): relative path to the template file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 24151a7a..3ead9783 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ and in ejs template files (for example templates/index.ejs) use something like: ```html <%- include('header.ejs') %> ``` -with a path relative to the current page, or an absolute path. Please check this example [here](https://raw.githubusercontent.com/fastify/point-of-view/c7ff7775cbc8dcf1a7194a517efbf243a74bd0be/templates/layout-with-includes.ejs) +with a path relative to the current page, or an absolute path. Please check this example [here](./templates/layout-with-includes.ejs) To use partials in mustache you will need to pass the names and paths in the options parameter: ```js