codigocomentado/templates/post.html.tera

38 lines
1.3 KiB
Plaintext
Raw Normal View History

2019-11-17 22:09:58 +00:00
{% extends "base" %}
{% block title %}CódigoComentado - {{post.title}}{% endblock title %}
2019-11-17 22:09:58 +00:00
2019-12-19 22:26:10 +00:00
{% block seo_metadata %}
2019-12-19 22:35:21 +00:00
<meta name="description" content="{{ post.content | split(pat=" ") | slice(end=20) | join(sep=" ") }}" />
2019-12-19 22:26:10 +00:00
<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://codigocomentado.herokuapp.com" />
2019-12-19 22:35:21 +00:00
<meta property="og:description" content="{{ post.content | split(pat=" ") | slice(end=20) | join(sep=" ") }}" />
2019-12-19 22:26:10 +00:00
{% endblock seo_metadata %}
2019-11-20 21:59:35 +00:00
{% 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 %}
2019-11-20 21:59:35 +00:00
{% endblock extracss %}
2019-11-17 22:09:58 +00:00
{% block content %}
2019-11-20 21:59:35 +00:00
<h1 class="title"><strong>Title: </strong>{{ post.title }}</h1>
<span class="date"><strong>Date: </strong>{{ post.created_at | date(format="%Y-%m-%d") }}</span>
2019-11-17 22:09:58 +00:00
<article>
<strong>Content:</strong>
{{ post.content | safe }}
2019-11-17 22:09:58 +00:00
</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 %}