From 52106f1d3f64c49eb2be67c0801dfb4aa8205353 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Mon, 30 Oct 2017 14:58:50 +1100 Subject: [PATCH] Make shortlinks discoverable by displaying them on each entry, with extraneous bits trimmed out --- entries/templates/entries/h-entry.html | 8 ++++++-- lemoncurry/templatetags/friendly_url.py | 10 ++++++++++ lemoncurry/templatetags/shortlink.py | 10 ++++++++++ lemoncurry/utils.py | 12 +++++++++++- 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 lemoncurry/templatetags/friendly_url.py create mode 100644 lemoncurry/templatetags/shortlink.py diff --git a/entries/templates/entries/h-entry.html b/entries/templates/entries/h-entry.html index c46b121..bf3b2b0 100644 --- a/entries/templates/entries/h-entry.html +++ b/entries/templates/entries/h-entry.html @@ -1,4 +1,4 @@ -{% load humanize markdown %}
+{% load friendly_url humanize markdown shortlink %}
{% if entry.photo %}{% endif %}
{% if entry.name %}

{{ entry.name }}

{% endif %} @@ -9,12 +9,16 @@ {{ entry.author.first_name }} {{ entry.author.last_name }} - + + {% shortlink entry as short %} + + {{ short | friendly_url }} + {% if entry.updated != entry.published %}