Skip to content

Commit

Permalink
fixed a bug with write command
Browse files Browse the repository at this point in the history
  • Loading branch information
dvidsilva committed May 4, 2023
1 parent 2cf1c0d commit a6ce77b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Next Version

# 2.1.9
- Fixed a bug on the write method

# 2.1.8
- Wrote github action to publish github package

Expand Down
6 changes: 4 additions & 2 deletions lib/utils/compilers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ const getLayoutHTML = (item, files) => {
*/
const interpolateLayoutAndContent = (layout, item, data) => {
// currently no support for nested layouts
const html = marked.parse(item.content);
// const html = marked.parse(item.content);
data.page.html = marked.parse(item.content);

// compile template using site data and content of page
const layout_template = Handlebars.compile(layout);
const layout_with_html = layout_template({ ...data, content: html });
const layout_with_html = layout_template({ ...data });

// replace variables with values (handlebars) in full content
const template = Handlebars.compile(layout_with_html);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gloriajs/gloria",
"version": "2.1.8",
"version": "2.1.9",
"description": "Gloria is a NodeJS simple static website generator.",
"main": "cli.js",
"bin": "cli.js",
Expand Down

0 comments on commit a6ce77b

Please sign in to comment.