The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Add get_post_link template tag to create post backlinks

master
Gergely Polonkai 8 years ago
parent ed7a61207a
commit 34d1cefe70
  1. 8
      blog/templatetags/blog_link.py

@ -0,0 +1,8 @@
from django import template
from django.core.urlresolvers import reverse
register = template.Library()
@register.simple_tag(takes_context = True)
def get_post_link(context, post):
return context['request'].build_absolute_uri(reverse('blog:read', args=(post.created_at.year, post.created_at.month, post.created_at.day, post.slug)))
Loading…
Cancel
Save