Files
pillar/src/templates/nodes/custom/blog/index.pug

47 lines
1.3 KiB
Plaintext
Raw Normal View History

| {% extends 'layout.html' %}
| {% import 'nodes/custom/blog/_macros.html' as blogmacros %}
| {% from 'projects/_macros.html' import render_secondary_navigation %}
| {% from '_macros/_navigation.html' import navigation_homepage %}
| {% set title = 'blog' %}
| {% block page_title %}Blog{% endblock%}
| {% block navigation_tabs %}
| {% if project.url == 'blender-cloud' %}
| {{ navigation_homepage(title) }}
| {% else %}
| {{ render_secondary_navigation(project, navigation_links, title) }}
| {% endif %}
| {% endblock navigation_tabs %}
| {% block body %}
2018-09-16 02:04:14 +02:00
| {{ blogmacros.render_blog_index(node, project, posts, can_create_blog_posts, api, more_posts_available, posts_meta, pages=pages) }}
| {% endblock %}
| {% block footer_scripts %}
include ../_scripts
2016-12-01 16:42:17 +01:00
script.
hopToTop(); // Display jump to top button
/* Expand images when their link points to a jpg/png/gif */
/* TODO: De-duplicate code from view post */
var page_overlay = document.getElementById('page-overlay');
$('.item-content a img').on('click', function(e){
e.preventDefault();
var href = $(this).parent().attr('href');
var src = $(this).attr('src');
if (href.match("jpg$") || href.match("png$") || href.match("gif$")) {
$(page_overlay)
.addClass('active')
.html('<img src="' + src + '"/>');
} else {
window.location.href = href;
2017-03-23 18:52:24 +01:00
}
});
| {% endblock %}