blog-markdown #31

Merged
PlexSheep merged 27 commits from blog-markdown into devel 2023-10-02 11:31:41 +02:00
2 changed files with 9 additions and 2 deletions
Showing only changes of commit e8c332fce4 - Show all commits

View File

@ -1,4 +1,5 @@
{% load i18n %}
{% load helper_tags %}
{% get_current_language as LANGUAGE_CODE %}
<div class="container-lg mt-5">
<h4 class="">{% trans "Featured" %}</h4>
@ -45,6 +46,12 @@
{% endfor %}
</ul>
</div>
<div class="container p-1 text-center" style="border-top: solid">
<li class="list-group-item">
{% format_time post.date "%F" as date %}
{% trans "published" %}: {{ date }}
</li>
</div>
</a>
</div>
{% endfor %}

View File

@ -11,8 +11,8 @@ logger = logging.getLogger(__name__)
register = Library()
@register.simple_tag
def format_time(timestamp: datetime) -> str:
return timestamp.strftime("%F %H:%M:%S")
def format_time(timestamp: datetime, format: str = "%F %H:%M:%S") -> str:
return timestamp.strftime(format)
@register.simple_tag(takes_context=True)
def change_lang(context, lang="de", *args, **kwargs):