Nunjucks dynamic page template

290
August 01, 2017, at 10:03 PM

i'm using nunjucks (gulp) as templating language and i want to build a dynamic page template.

This is my Json:

"pages": [
    {
        uname: "Welcome",
        title: "Page 1 Headline"
    },
    {
        uname: "About",
        title: "Page 2 Headline"
    }
]

Currently i have a static page (html) template for each page:

{% extends "layout.html" %}
{% set active_page = "Welcome" %} //<- This needs to be dynamicly
{% block content %}
<h1>{{ page[0].title }}</h1> //<- This needs to be dynamicly

My first thought was to read the url parameters but i couldn't solve it in this way.

Any suggestions?

READ ALSO
Nightwatchjs getvalue of several input

Nightwatchjs getvalue of several input

Is there any way using nightwatchjs to get the value of several inputs?

335
ExtrudeGeometry texture difference with BoxGeometry

ExtrudeGeometry texture difference with BoxGeometry

I have two objects, THREEBoxGeometry and extruded THREE

429
Mouseenter Event Failing to Trigger

Mouseenter Event Failing to Trigger

I have a set of 3 menu items that i'm trying to add a mouseenter event toI can't seem to get it to work at all

280