diff --git a/example/views/home.njk b/example/views/home.njk index 31847cc..a7a5813 100644 --- a/example/views/home.njk +++ b/example/views/home.njk @@ -2,7 +2,4 @@ {% block main %} - -{{ page.content | safe }} - {% endblock %} \ No newline at end of file diff --git a/example/views/layout.njk b/example/views/layout.njk index a02a69e..fd77dc1 100644 --- a/example/views/layout.njk +++ b/example/views/layout.njk @@ -22,7 +22,7 @@

- {{ page.title }} +

diff --git a/example/views/page.njk b/example/views/page.njk index 9a05092..e3728e2 100644 --- a/example/views/page.njk +++ b/example/views/page.njk @@ -2,8 +2,4 @@ {% block main %} {{ page.content | safe }} - -{% for hero in page.blocks.hero %} - {{ hero.content }} -{% endfor %} {% endblock %} \ No newline at end of file diff --git a/src/engines/nunjucks.js b/src/engines/nunjucks.js index 7ac9e70..4c9f901 100644 --- a/src/engines/nunjucks.js +++ b/src/engines/nunjucks.js @@ -65,7 +65,7 @@ class Engine { render(view, data, done) { // merge data - data = assign({}, data, this._defaults) + data = assign(data, this._defaults) this.nunjucks.render(view, data, (error, response) => { done(error, response) diff --git a/src/models/page.js b/src/models/page.js index 5c81022..bbf04e1 100644 --- a/src/models/page.js +++ b/src/models/page.js @@ -57,7 +57,7 @@ class Page { */ render(engine, done) { - const page = assign({}, this.fields) + const page = merge({}, this.fields) page.content = this.content page.blocks = this.blocks diff --git a/src/queries/pages.js b/src/queries/pages.js index a09b1cc..4fb41e6 100644 --- a/src/queries/pages.js +++ b/src/queries/pages.js @@ -77,7 +77,7 @@ class Pages { direction = 'desc' } - this._results = orderBy(this._results, '_fields.' + key, direction) + this._results = orderBy(this._results, key, direction) }) }