summaryrefslogtreecommitdiff
path: root/blog/templates/blog/blog_post.html
blob: 5394f2958439831ad4cd7f48749495d1d3bec04f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{% extends "base.html" %}
{% load static %}

{% load wagtailcore_tags %}
{% load wagtailcore_tags wagtailimages_tags %}

{% block body_class %}template-blogpage{% endblock %}

{% block content %}

<div class="container">

    <div class="row">

      <!-- Post Content Column -->
      <div class="col-lg-8">

        <!-- Title -->
        <h1 class="mt-4">{{ page.title }}</h1>
        <!-- Date/Time -->
        {% with categories=page.categories.all %}
        <p>Posted on {{ page.date }}{% if categories %} in {{ categories|join:", " }}{% endif %}</p>
        {% endwith %}
        <hr>

        <!-- Preview Image -->
        {% if page.main_image %}
        {% image page.main_image fill-900x300-c100 class="img-fluid rounded" %}
        <hr>
        {% endif %}

        <!-- Post Content -->
        <p class="lead">{{ page.intro }}</p>

        {% include_block page.body %}
    

      </div>

      <!-- Sidebar Widgets Column -->
      <div class="col-md-4">
        {% include "search.html" %}
        <!-- Tags Widget -->
        <div class="card my-4">
          <h5 class="card-header">Tags</h5>
          <div class="card-body">
            <div class="row">
              <div class="col-lg-10">
                <ul class="list-unstyled mb-0">
                  {% if page.tags.all.count %}
                  {% for tag in page.tags.all %}
                  <span class="badge badge-light"><a href="{% slugurl 'tags' %}?tag={{ tag }}">{{ tag }}</a></span>
                  {% endfor %}
                  {% else %}
                  No tags for this post
                  {% endif %}
              </div>
            </div>
          </div>
        </div>


      </div>

    </div>

    <p><a href="{{ request.META.HTTP_REFERER }}">Return to previous page</a></p>
{% endblock %}