Fix for broken urls in blog list
This actually undoes commits90c62664a6
and18fe240b93
and simply adds the node.url property when rendering a post in the posts_view function. This is what the template macro actually expected in the first place.
This commit is contained in:
@@ -35,7 +35,6 @@ def posts_view(project_id=None, project_url=None, url=None, *, archive=False, pa
|
|||||||
|
|
||||||
api = system_util.pillar_api()
|
api = system_util.pillar_api()
|
||||||
|
|
||||||
# Fetch project (for backgroud images and links generation)
|
|
||||||
# Fetch project (for background images and links generation)
|
# Fetch project (for background images and links generation)
|
||||||
if project_id:
|
if project_id:
|
||||||
project = Project.find(project_id, api=api)
|
project = Project.find(project_id, api=api)
|
||||||
@@ -78,6 +77,8 @@ def posts_view(project_id=None, project_url=None, url=None, *, archive=False, pa
|
|||||||
|
|
||||||
if post.picture:
|
if post.picture:
|
||||||
post.picture = get_file(post.picture, api=api)
|
post.picture = get_file(post.picture, api=api)
|
||||||
|
|
||||||
|
post.url = url_for_node(node=post)
|
||||||
elif posts._items:
|
elif posts._items:
|
||||||
post = posts._items[0]
|
post = posts._items[0]
|
||||||
else:
|
else:
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//- ******************************************************* -//
|
//- ******************************************************* -//
|
||||||
| {% macro render_blog_post(node) %}
|
| {% macro render_blog_post(node) %}
|
||||||
| {% if node.picture %}
|
| {% if node.picture %}
|
||||||
a.blog_index-header(href="{{ node.properties.url }}")
|
a.blog_index-header(href="{{ node.url }}")
|
||||||
img(src="{{ node.picture.thumbnail('l', api=api) }}")
|
img(src="{{ node.picture.thumbnail('l', api=api) }}")
|
||||||
| {% endif %}
|
| {% endif %}
|
||||||
|
|
||||||
@@ -12,16 +12,16 @@ a.blog_index-header(href="{{ node.properties.url }}")
|
|||||||
| {% endif %}
|
| {% endif %}
|
||||||
|
|
||||||
li.when
|
li.when
|
||||||
a(href="{{ node.properties.url }}",
|
a(href="{{ node.url }}",
|
||||||
title="Updated {{ node._updated | pretty_date }}")
|
title="Updated {{ node._updated | pretty_date }}")
|
||||||
| {{ node._created | pretty_date }}
|
| {{ node._created | pretty_date }}
|
||||||
|
|
||||||
li
|
li
|
||||||
a(href="{{ node.properties.url }}#comments")
|
a(href="{{ node.url }}#comments")
|
||||||
| comment
|
| comment
|
||||||
|
|
||||||
a.item-title(
|
a.item-title(
|
||||||
href="{{ node.properties.url }}")
|
href="{{ node.url }}")
|
||||||
| {{ node.name }}
|
| {{ node.name }}
|
||||||
|
|
||||||
.item-content
|
.item-content
|
||||||
|
Reference in New Issue
Block a user