<commit_before># -*- coding: utf-8 -*-

from django import template
from django.conf import settings
from Instanssi.ext_blog.models import BlogEntry

register = template.Library()


@register.inclusion_tag('ext_blog/blog_messages.html')
def render_blog(event_id, max_posts=10):
    entries = BlogEntry.objects.filter(event_id__lte=int(event_id), public=True).order_by('-date')[:max_posts]
    return {'entries': entries}


@register.inclusion_tag('ext_blog/blog_rss_tag.html')
def render_blog_rss_tag():
    return {}


@register.simple_tag
def blog_rss_url():
    return 'http://'+settings.DOMAIN+'/blog/rss/'

<commit_msg>Dont show posts from earlier years in the blog<commit_after># -*- coding: utf-8 -*-

from django import template
from django.conf import settings
from Instanssi.ext_blog.models import BlogEntry

register = template.Library()


@register.inclusion_tag('ext_blog/blog_messages.html')
def render_blog(event_id, max_posts=10):
    entries = BlogEntry.objects.filter(event_id=int(event_id), public=True).order_by('-date')[:max_posts]
    return {'entries': entries}


@register.inclusion_tag('ext_blog/blog_rss_tag.html')
def render_blog_rss_tag():
    return {}


@register.simple_tag
def blog_rss_url():
    return 'http://'+settings.DOMAIN+'/blog/rss/'


{'fraction_non_alphanumeric': 0.13636363636363635, 'fraction_numerical': 0.004702194357366771, 'mean_word_length': 5.616580310880829, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '403328', 'n_tokens_mistral': 426, 'n_tokens_neox': 417, 'n_words': 80}