codigocomentado/templates/post.html.tera

38 lines
1.3 KiB
Plaintext

{% extends "base" %}
{% block title %}CódigoComentado - {{post.title}}{% endblock title %}
{% block seo_metadata %}
<meta name="description" content="{{ post.content | split(pat=" ") | slice(end=20) | join(sep=" ") }}" />
<meta name="robots" content="index,follow" />
<meta name="twitter:card" value="summary">
<meta property="og:title" content="{{ post.title }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://blog.kirbylife.dev" />
<meta property="og:description" content="{{ post.content | split(pat=" ") | slice(end=20) | join(sep=" ") }}" />
{% endblock seo_metadata %}
{% block extracss %}
<link href="/static/css/post.css" rel="stylesheet"/>
{% if post.content is containing("<code>") %}
<link href="/static/css/highlightjs/agate.css" rel="stylesheet"/>
{% endif %}
{% endblock extracss %}
{% block content %}
<h1 class="title"><strong>Title: </strong>{{ post.title }}</h1>
<span class="date"><strong>Date: </strong>{{ post.created_at | date(format="%Y-%m-%d") }}</span>
<article>
<strong>Content:</strong>
{{ post.content | safe }}
</article>
{% endblock content %}
{% block extrajs %}
{% if post.content is containing("<code>") %}
<script src="/static/js/highlight.pack.js"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
{% endif %}
{% endblock extrajs %}