Complete migration to Jinja2 by porting the home page template
This commit is contained in:
parent
b145f4ada9
commit
77816b6c5d
9 changed files with 137 additions and 324 deletions
|
@ -1,17 +0,0 @@
|
|||
{% extends 'lemoncurry/layout.html' %}
|
||||
{% load absolute_url static %}
|
||||
|
||||
{% block head %}
|
||||
<link rel="shortlink" href="{{ entry.short_url }}" />
|
||||
<link rel="alternate" type="application/json+oembed" href="https://wirres.net/oembed/oembed.php?url={{ uri | absolute_url | urlencode }}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block styles %}
|
||||
<link rel="stylesheet" type="text/stylus" href="{% static 'entries/css/h-entry.styl' %}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div class="entry">
|
||||
{% include 'entries/h-entry.html' %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,67 +0,0 @@
|
|||
{% load bleach friendly_url humanize jsonify markdown %}<article class="card h-entry">
|
||||
{% if entry.photo %}<img class="card-img-top u-photo" src="{{ entry.photo.url }}" />{% endif %}
|
||||
|
||||
{% if entry.in_reply_to %}{% with reply=entry.reply_context %}
|
||||
<article class="card-header media u-in-reply-to h-cite">
|
||||
<a class="align-self-center p-author h-card" href="{{ reply.author.url }}">
|
||||
<img class="mr-3 rounded" width="100" src="{{ reply.author.photo }}"
|
||||
alt="{{ reply.author.name }}" title="{{ reply.author.name }}" />
|
||||
</a>
|
||||
<div class="media-body">
|
||||
{% if reply.name %}<h4 class="p-name">{{ reply.name }}</h4>{% endif %}
|
||||
<div class="e-content{% if not reply.name %} p-name{% endif %}">{{ reply.content | bleach }}</div>
|
||||
</div>
|
||||
</article>{% endwith %}{% endif %}
|
||||
|
||||
<div class="card-body">
|
||||
{% if entry.name %}<h4 class="card-title p-name">{{ entry.name }}</h4>{% endif %}
|
||||
<div class="e-content{% if not entry.name %} p-name{% endif %}">{{ entry.content | markdown }}</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<a class="p-author h-card" href="{{ entry.author.url }}">
|
||||
<img class="u-photo" src="{{ entry.author.avatar.url }}" />
|
||||
{{ entry.author.first_name }} {{ entry.author.last_name }}
|
||||
</a>
|
||||
<a class="u-uid u-url" href="{{ entry.url }}">
|
||||
<time class="dt-published" datetime="{{ entry.published.isoformat }}">
|
||||
<i class="fas fa-calendar"></i>
|
||||
{{ entry.published | naturaltime }}
|
||||
</time>
|
||||
</a>
|
||||
{% if entry.updated != entry.published %}
|
||||
<time class="dt-updated" datetime="{{ entry.updated.isoformat }}">
|
||||
<i class="fas fa-pencil-alt"></i>
|
||||
{{ entry.updated | naturaltime }}
|
||||
</time>
|
||||
{% endif %}
|
||||
<a class="u-url" href="{{ entry.short_url }}">
|
||||
<i class="fas fa-link"></i>
|
||||
{{ entry.short_url | friendly_url }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% if entry.cats.exists %}
|
||||
<div class="card-footer">
|
||||
{% for c in entry.cats.all %}
|
||||
<a class="p-category" href="{{ c.url }}">
|
||||
<i class="fas fa-paw"></i>
|
||||
{{ c.name }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if entry.syndications.exists %}
|
||||
<div class="card-footer">
|
||||
{% for s in entry.syndications.all %}
|
||||
<a class="u-syndication" href="{{ s.url }}">
|
||||
<i class="{{ s.profile.site.icon }}" aria-hidden="true"></i>
|
||||
{{ s.profile }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<script class="p-json-ld" type="application/ld+json">{{ entry.json_ld | jsonify }}</script>
|
||||
</article>
|
|
@ -1,17 +0,0 @@
|
|||
{% extends 'lemoncurry/layout.html' %}
|
||||
{% load static %}
|
||||
{% block html_class %}h-feed{% endblock %}
|
||||
|
||||
{% block styles %}
|
||||
<link rel="stylesheet" type="text/stylus" href="{% static 'entries/css/h-entry.styl' %}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<ol class="list-unstyled entries">
|
||||
{% for entry in entries %}
|
||||
<li>
|
||||
{% include 'entries/h-entry.html' %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue