-
Notifications
You must be signed in to change notification settings - Fork 3
/
home.j2
54 lines (50 loc) · 2.1 KB
/
home.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{% from "macros.j2" import render_subject_content %}
{% block style %}
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://s3.typlog.com/npm/@typlog/[email protected]/yue.css">
<link rel="stylesheet" href="{{ static_url }}meguro.css">
{% endblock %}
{% set items = query.latest_subjects('post', contains=['authors', 'tags', 'content']) %}
{% if items %}
{% set page = items[0] %}
{% else %}
{% set page = None %}
{% endif %}
{% block body %}
{% include "./_partials/head.j2" %}
<div class="main">
<div class="inner">
{% if page %}
<article role="main" class="h-entry" itemscope itemtype="http://schema.org/Article">
<h1 class="p-name" itemprop="headline"><a href="{{ linkify(page.url) }}">{{ page.title }}</a></h1>
{% if page.subtitle %}
<h2 class="p-summary">{{ page.subtitle }}</h2>
{% endif %}
<div class="tags">
{% for tag in page.tags %}
{% set color = tag.metadata.color %}
<a class="{{ tag.slug }}" href="{{ linkify(tag.url) }}"{% if color %} style="--color:{{ color }}"{% endif %}>{{ tag.title }}</a>
{% endfor %}
</div>
<div class="e-content js-content yue" itemprop="articleBody">
{{ render_subject_content(site, page) }}
</div>
<a class="published" href="{{ linkify(page.url) }}">
<time datetime="{{ page.published_at|xmldatetime }}" itemprop="datePublished">{{ page.published_at.strftime("%Y-%m-%d") }}</time>
</a>
</article>
{% endif %}
{% set logs = items[1:] %}
{% include "./_partials/logs.j2" %}
{% if items|count == 10 %}
{% set last = items|last %}
<div class="home-more">
<a href="{{ linkify(site.list_url) }}{{last.published_at.year}}/#item-{{last.id}}">ARCHIVE →</a>
</div>
{% endif %}
</div>
</div>
{% include "./_partials/foot.j2" %}
{% endblock %}