-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathposts.njk
30 lines (24 loc) · 981 Bytes
/
posts.njk
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
---
pagination:
data: posts
size: 1
alias: posts
permalink: "posts/{{ posts.title.rendered | slug | safe }}/"
layout: 'layouts/article.njk'
---
{% include 'components/_backHome.njk' %}
<article class="mt-4 mx-auto p-4 sm:px-10 prose prose-base md:prose-lg prose-slate
dark:prose-invert prose-a:text-blue-500 prose-a:no-underline hover:prose-a:underline">
<h1 class="capitalize">{{ posts.title.rendered | safe}}</h1>
{# on wordpress, single post has embed link to the summary post, here need to remove this link #}
<div class="">
{{posts.content.rendered | removeWpEmbedUrl| safe}}
</div>
</article>
<div class="w-full mx-auto grid place-content-center">
{% include 'components/_pagination.njk' %}
</div>
{% include 'components/_backHome.njk' %}
{# template for single post, the URL to each post will be at /posts/slug #}
{# |slug filter is to slugify the url #}
{# |safe filter is to render out the HTML we get back from WP REST API #}