beeware.github.io/templates/blog-post.html
Luna Meadows cbe4a851dc
Apply suggestions from code review
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2023-04-07 06:21:35 -05:00

50 lines
1.8 KiB
HTML

{% extends "layout.html" %}
{% from "macros/blog.html" import render_blog_post %}
{% from "macros/breadcrumbs.html" import breadcrumbs %}
{% from "macros/translation.html" import transbag %}
{% set t_on = transbag('translate', this.alt, 'on') %}
{% set t_posted_by = transbag('translate', this.alt, 'posted_by') %}
{% set t_next_entry = transbag('translate', this.alt, 'next_entry') %}
{% set t_previous_entry = transbag('translate', this.alt, 'previous_entry') %}
{% block title %}{{ this.title }}{% endblock %}
{% block preamble %}
<div class="banner">
<div class="container">
<p>{{ breadcrumbs(this) }}</p>
<h1>{{ this.title }}</h1>
<p>{{ t_posted_by }}
{% if this.mastodon_handle %}
<a href="https://{{ this.mastodon_handle.split('@')[2] }}/@{{ this.mastodon_handle.split('@')[1] }}">{{ this.author or this.mastodon_handle }}</a>
{% elif this.twitter_handle %}
<a href="https://twitter.com/{{ this.twitter_handle }}">{{ this.author or this.twitter_handle }}</a>
{% else %}
{{ this.author }}
{% endif %}
{{ t_on }} {{ this.pub_date.strftime('%Y/%m/%d')}}
</p>
</div>
</div>
{% endblock %}
{% block body %}
<div class="row-fluid">
<div class="col-sm-12 col-md-10 col-lg-8" >
{{ render_blog_post(this) }}
</div>
<div class="hidden-sm-down col-md-2 col-lg-4"></div>
<div class="col-sm-12 col-md-4 gutter">
<dl>
{% if this.has_prev() %}
<dt>{{ t_next_entry }}</dt>
<dd><a href="{{ this.get_siblings().prev_page|url(alt=this.alt) }}">{{ this.get_siblings().prev_page.title }}</a></dd>
{% endif %}
{% if this.has_next() %}
<dt>{{ t_previous_entry }}</dt>
<dd><a href="{{ this.get_siblings().next_page|url(alt=this.alt) }}">{{ this.get_siblings().next_page.title }}</a></dd>
{% endif %}
</dl>
</div></div>
{% endblock %}