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().
This commit is contained in:
@@ -29,6 +29,18 @@ include ../_scripts
|
||||
|
||||
| {% 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 %}
|
||||
|
Reference in New Issue
Block a user