-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthor-resource.html.twig
More file actions
88 lines (78 loc) · 4.57 KB
/
Copy pathauthor-resource.html.twig
File metadata and controls
88 lines (78 loc) · 4.57 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{% extends '@layout/default.html.twig' %}
{% block json_ld %} {{ include('@jsonld/author-resource.jsonld.twig') }} {% endblock %}
{% block title %}{{ author.name }}{% endblock %}
{% block page_title %}
<div class="wrap">
<div class="post-hero-v2">
<div class="hero-top-row">
<a href="{{ url('page::blog') }}" class="breadcrumb-back">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 18l-6-6 6-6"/></svg>
Back to Blog
</a>
<div class="hero-badge">
<span>Author</span>
</div>
</div>
<h1>Articles by {{ author.name }}</h1>
<div class="post-meta-v2 mt-3">
<span class="meta-item">
Also on
</span>
{% if author.github %}
<span class="meta-item">
<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true">
<path d="M12 .5C5.73.5.5 5.73.5 12c0 5.09 3.29 9.4 7.86 10.93.57.1.79-.25.79-.55 0-.27-.01-1.17-.02-2.12-3.2.7-3.88-1.36-3.88-1.36-.52-1.34-1.28-1.7-1.28-1.7-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11 11 0 0 1 5.8 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.24 2.76.12 3.05.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.07.78 2.16 0 1.56-.01 2.82-.01 3.2 0 .31.21.66.8.55A11.5 11.5 0 0 0 23.5 12c0-6.27-5.23-11.5-11.5-11.5z"/>
</svg>
<a href="https://github.com/{{ author.github }}" target="_blank" rel="noopener noreferrer">{{ author.github }}</a>
</span>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="wrap post-body-wrap">
<div class="post-layout">
{{ include('@partial/left-menu.html.twig') }}
<main class="article">
<div class="posts-grid-2-col">
{% for post in data.items %}
<a class="post-card"
href="{{ url('page::blog-resource', {categorySlug: post.category.slug, slug: post.slug}) }}">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"
style="width:20px;height:20px;color:var(--teal);" aria-hidden="true">
<path d="M4 4h11l5 5v11a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z"/>
<path d="M14 4v6h6"/>
</svg>
<span class="post-card-kicker">{{ post.category.name }}</span>
<h4>{{ post.title }}</h4>
<p>{{ post.excerpt|length > 200 ? post.excerpt|slice(0, 200)|trim ~ '…' : post.excerpt }}</p>
<span class="post-date">{{ post.postDate|date('M d, Y') }}</span>
<span class="read-more">Read more →</span>
</a>
{% else %}
<div class="card posts-empty">
<p class="desc">No posts found.</p>
</div>
{% endfor %}
</div>
{% if data.lastPage > 1 %}
<nav class="pagination-row mt-3" aria-label="Author posts pagination">
<a class="btn btn-ghost btn-sm {% if data.isFirstPage %}disabled{% endif %}"
href="?page={{ data.previousPage }}" aria-label="Previous page">←</a>
{% for p in data.pages %}
<a class="btn btn-sm {% if p == data.currentPage %}btn-primary{% else %}btn-ghost{% endif %}"
href="?page={{ p }}">{{ p }}</a>
{% endfor %}
<a class="btn btn-ghost btn-sm {% if data.isLastPage %}disabled{% endif %}"
href="?page={{ data.nextPage }}" aria-label="Next page">→</a>
</nav>
<p class="post-date pagination-summary">
Page {{ data.currentPage }} of {{ data.lastPage }}
. {{ data.count }} articles total
</p>
{% endif %}
</main>
</div>
</div>
{% endblock %}