blog.templatetags.blog_tags

Functions

get_archive_digest([months_count]) Simple tag
get_blog_menu_links() Simple tag
get_categories() Simple tag
get_disqus_shortname
get_posts_digest([featured, posts_count]) Simple tag
get_site_name
get_url
render_disqus_comments
render_google_analytics
render_paginator(context[, adjacent_pages]) Inclusion tag

Classes

SideBarObjects(objects, more)
class blog.templatetags.blog_tags.SideBarObjects(objects, more)

Bases: tuple

more

Alias for field number 1

objects

Alias for field number 0

Bases: tuple

caption

Alias for field number 0

url

Alias for field number 1

blog.templatetags.blog_tags.get_categories()[source]

Simple tag

Returns:list of non-empty categories ordered by post count in desc. order
blog.templatetags.blog_tags.get_posts_digest(featured=False, posts_count=3)[source]

Simple tag

Get the lists of the latest posts (general of featured) for the blog sidebar

Parameters:
  • featured – if True featured posts digest is returned
  • posts_count – the number of posts to include in a digest
Returns:

the digest of recent posts and “More” link

Return type:

SideBarObjects

blog.templatetags.blog_tags.get_archive_digest(months_count=6)[source]

Simple tag

Parameters:months_count – the number of month to include in a digest
Returns:the list of the most recent months from the blog archive for the blog sidebar
Return type:SideBarObjects

Simple tag

Returns:blog menu links for the site main menu.
blog.templatetags.blog_tags.render_paginator(context, adjacent_pages=2)[source]

Inclusion tag

Renders paginator for multi-page lists.

A skin must provide the respective paginator template.

Adds pagination context variables for use in displaying first, adjacent and last page links in addition to those created by the object_list generic view.

Parameters:
  • context – parent template context
  • adjacent_pages – the number of pages adjacent to the current
Returns:

rendered paginator html code

blog.templatetags.blog_tags.check_blog_url(context)[source]

Check if a current URL belong to blog application

Parameters:context (dict) – template context
Returns:check result
Return type:bool
blog.templatetags.blog_tags.blog_json_ld(context)[source]

Renders JSON-LD for the blog

Parameters:context (dict) – parent template context
Returns:context for json-ld template
Return type:dict
blog.templatetags.blog_tags.blog_post_json_ld(context)[source]

Renders JSON-LD for the blog

Parameters:context (dict) – parent template context
Returns:context for json-ld template
Return type:dict