Features

Comments

You can enable / disable comments on app, blog and post-level. For app-level, there’s a global switch you can use in the settings. Blog and post models have a comments_enabled database field. They are set to True by default.

Settings

# Switch to enable/disable comments globally. By default it's False
CAST_COMMENTS_ENABLED = True

Caveats

The ajax-calls django-fluent-comments does depend on the availability of a full jquery version. The min-version shipped by cookiecutter-django is not sufficient, therefore an additional jquery version is loaded on the post detail page when comments are enabled.

Content

The content of a blog post is just a normal django template. There are some special templatetags and context variables, though.

Templatetags

There are some templatetags to include media models from uploads into your post content. If you use the javascript editing frontend the primary keys for media models will be set automatically.

Image

To include an image, simply use the image templatetag:

{% image 1 %}

The number denotes the primary key of the image model. The templatetag will handle the srset attribute for you automatically.

Video

To include an video, simply use the video templatetag:

{% video 1 %}

The number denotes the primary key of the video model. The templatetag will handle the poster attribute for you automatically.

Audio

To include an audio model, simply use the audio templatetag:

{% audio 1 %}

The number denotes the primary key of the audio model. The templatetag won’t do that much, because the player is pure javascript and chaptermarks and other metadata are pulled from a rest-api by the player. Note that you have to explicitly set the podcast_audio if you want some audio model included as the podcast episode audio. There can only be one such model whereas you can link to an arbitrary number of audio models that are not the podcast episode audio.

Content in post list and detail view

If you want some content only to be visible on the post detail page, just wrap it with an if-tag that evaluates a contenxt varible set by the list/detail view:

{% if include_detail %}
    This content will only be visible on the post detail page.
{% endif  %}

This might be useful for long shownotes-sections you have sometimes for podcast episodes etc..

Templates

There are some ready to use templates included. For example to display the list of posts or the detail page of a post. Often there are blocks that can be overwritten to customize the appearance of those templates.

Example Podcast

Feeds

For a podcast like python-podcast.de you may want to add the podlove-subscribe-button instead of having the default feed icon. This is quite easy to accomplish. Just create a template named templates/cast/post_list.html and set the content to:

{% extends "cast/post_list.html" %}
{% block feeds %}
<p>
<script>window.podcastData={"title":"Python Podcast","subtitle":"Ein deutschsprachiger Podcast rund um die Programmiersprache Python","description":"","cover":"https://d2mmy4gxasde9x.cloudfront.net/cast_images/itunes_artwork/pp_itunes_artwork_3k.png","feeds":[{"type":"audio","format":"aac","url":"https://python-podcast.de/show/feed/podcast/m4a/rss.xml","directory-url-itunes":"https://podcasts.apple.com/de/podcast/python-podcast/id1445331513"},{"type":"audio","format":"mp3","url":"https://python-podcast.de/show/feed/podcast/mp3/rss.xml","directory-url-itunes":"https://podcasts.apple.com/de/podcast/python-podcast/id1445331513"},{"type":"audio","format":"ogg","url":"https://python-podcast.de/show/feed/podcast/oga/rss.xml","directory-url-itunes":"https://podcasts.apple.com/de/podcast/python-podcast/id1445331513"},{"type":"audio","format":"opus","url":"https://python-podcast.de/show/feed/podcast/opus/rss.xml","directory-url-itunes":"https://podcasts.apple.com/de/podcast/python-podcast/id1445331513"}]}</script><script class="podlove-subscribe-button" src="https://cdn.podlove.org/subscribe-button/javascripts/app.js" data-language="de" data-size="big" data-json-data="podcastData" data-color="#469cd1" data-format="cover" data-style="filled"></script><noscript><a href="https://python-podcast.de/show/feed/podcast/m4a/rss.xml">Subscribe to feed</a></noscript>
</p>
{% endblock feeds %}

The javascript snipped was generated by the subscribe-button-generator which was also really easy.

Post Detail Link

Or maybe you want to overwrite the default post detail link if you used “{% if include_detail %}” to exclude the shownotes of your podcast from the episode list view.

{% extends "cast/post_list.html" %}
{% load i18n %}

{% block detail_link %}
<a href="{% url "cast:post_detail" blog_slug=blog.slug slug=post.slug %}">
  Shownotes | {% trans "Comments" %} | Permalink
</a>
{% endblock detail_link %}