Files
pillar/src/templates/nodes/custom/page/view_embed.jade
Francesco Siddi 6bb491aadc Support for page urls
Now we can access pages with the following url
/p/<project_url>/<page-url>. Internally we use the existing view_node,
but if we detect that the node_id is not an object id we try to treat
it as a page url and therefore we try to define node and project using
render_node_page().
2016-12-02 16:57:51 +01:00

48 lines
1.2 KiB
Plaintext

| {% block body %}
#node-container
#node-overlay
| {% if node.picture %}
section#node-preview.node-preview.page
img.node-preview-thumbnail#node-preview-thumbnail(
src="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
section.node-details-container.page
.node-details-header
.node-title#node-title
| {{node.name}}
| {% if node.description %}
.node-details-description#node-description
| {{node.description}}
| {% endif %}
.node-details-meta.footer
span.updated(title="created {{ node._created | pretty_date }}") updated {{ node._updated | pretty_date }}
include ../_scripts
| {% endblock %}
| {% block footer_scripts %}
script.
// Push the correct URL onto the history. This push happens after the id has
// been pushed to the history already. We should probably keep only this and
// skip the project-level displayNode push.
var url = '{{ node.properties.url }}'
var push_state = {nodeId: '{{node._id}}', url: url};
// console.log('Pushing state ', push_state, ' with URL ', push_url);
window.history.pushState(
push_state,
'{{node.properties.url}}',
url
);
// Generate GA pageview
ga('send', 'pageview', location.pathname);
| {% endblock %}