{% extends "note_base.html" %}
+{% load notes_extras %}
-{% block title %}Archive {{ month }} / {{ year }} – Notes{% endblock %}
+{% block title %}Archive {{ month|month_name}} / {{ year }} – Notes{% endblock %}
{% block content %}
-<h2>Archive {{ month }} / {{ year }}</h2>
+<h2>Archive {{ month|month_name }} / {{ year }}</h2>
{% if notes %}
<ul>
{% extends "note_base.html" %}
+{% load notes_extras %}
{% block title %}Archive {{ year }} – Notes{% endblock %}
{% if months %}
<ul>
{% for month in months %}
- <li><a href="{{ month }}/">{{ month }}</a></li>
+ <li><a href="{{ month }}/">{{ month|month_name }}</a></li>
{% endfor %}
</ul>
{% else %}
import markdown as md
from markdown.extensions import Extension
+import calendar
+
register = template.Library()
# See https://python-markdown.github.io/change_log/release-3.0/#safe_mode-and-html_replacement_text-keywords-deprecated
@register.filter
@stringfilter
def markdown(value):
- return md.markdown(value, extensions=[EscapeHtml(), 'nl2br'])
\ No newline at end of file
+ return md.markdown(value, extensions=[EscapeHtml(), 'nl2br'])
+
+@register.filter
+def month_name(value):
+ return calendar.month_name[value]
\ No newline at end of file