Blog: Unify all post viewing in one template

During the years we went from site-wide blog, to project blog, to
post view inside a project, to full one-page post view. This led
to have multiple ways to see the same content.

This commit brings all post related stuff to always use index.pug
(or index_archive if we are looking blasts from the past).
This commit is contained in:
2018-09-14 20:29:44 +02:00
parent 232321cc2c
commit 78b186c8e4
6 changed files with 32 additions and 164 deletions

View File

@@ -1,68 +0,0 @@
| {% extends 'projects/view.html' %}
| {% set title = 'blog' %}
| {% block og %}
meta(property="og:title", content="{{ node.name }}")
meta(property="og:url", content="{{ url_for('main.project_blog', project_url=project.url, url=node.properties.url, _external=True)}}")
meta(property="og:type", content="website")
| {% if node.picture %}
meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
meta(property="og:description", content="Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.")
meta(name="twitter:title", content="{{ node.name }}")
meta(name="twitter:description", content="Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.")
| {% if node.picture %}
meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
| {% endblock %}
| {% block page_title %}{{node.name}} - Blog{% endblock%}
| {% block project_context %}
| {% include 'nodes/custom/post/view_embed.html' %}
| {% endblock %}
| {% block project_tree %}
#project_tree.jstree.jstree-default.blog
ul.jstree-container-ul.jstree-children
li.jstree-node(data-node-type="page")
a.jstree-anchor(
href="{{ url_for('projects.view', project_url=project.url) }}")
| Browse Project
li.jstree-node(data-node-type="page")
a.jstree-anchor(
href="{{ url_for('main.project_blog', project_url=project.url) }}") Blog
| {% for post in posts %}
li.jstree-node
a.jstree-anchor.tree-item.post(
href="{{ url_for_node(node=post) }}",
class="{% if post._id == node._id %}jstree-clicked{% endif %}")
.tree-item-thumbnail
| {% if post.picture %}
img(src="{{ post.picture.thumbnail('s', api=api) }}")
| {% else %}
i.pi-document-text
| {% endif %}
span.tree-item-title {{ post.name }}
span.tree-item-info {{ post._created | pretty_date }}
| {% endfor %}
| {% endblock %}
| {% block footer_scripts %}
script.
ProjectUtils.setProjectAttributes({projectId: "{{project._id}}", isProject: false, nodeId: '{{node._id}}'});
/* UI Stuff */
var project_container = document.getElementById('project-container');
$(window).on("load resize",function(){
containerResizeY($(window).height());
if ($(window).width() > 480) {
project_container.style.height = (window.innerHeight - project_container.offsetTop) + "px";
}
});
| {% endblock footer_scripts %}

View File

@@ -1,9 +0,0 @@
| {% import 'nodes/custom/blog/_macros.html' as blogmacros %}
| {{ blogmacros.render_blog_post(node, project=project) }}
#comments-embed.comments-compact
.comments-list-loading
i.pi-spin
include ../_scripts