feat(theme): support for series hint

- https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel#attr-next
This commit is contained in:
Ming Di Leom 2022-04-05 06:46:58 +00:00
parent f56b7c176c
commit d8c745dcf7
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
6 changed files with 22 additions and 1 deletions

View File

@ -8,6 +8,7 @@ tags:
- linux
- caddy
- nixos
series: first
---
In this segment, I show you how I install NixOS.

View File

@ -8,6 +8,7 @@ tags:
- linux
- caddy
- nixos
series: true
---
> 9 Nov 2020: Updated to NixOS 20.09 syntax.

View File

@ -9,6 +9,7 @@ tags:
- caddy
- nixos
- cloudflare
series: true
---
> 9 Nov 2020: Updated to Caddy 2.1 syntax. Refer to {% post_link caddy-upgrade-v2-proxy 'this article' %} for upgrade guide.

View File

@ -10,6 +10,7 @@ tags:
- nixos
- i2p
- censorship
series: last
---
> 9 Nov 2020: Updated to Caddy 2.1 syntax. Refer to {% post_link caddy-upgrade-v2-proxy 'this article' %} for upgrade guide.

View File

@ -10,6 +10,7 @@ tags:
- nixos
- tor
- censorship
series: true
---
> 9 Nov 2020: Updated to Caddy 2.1 syntax. Refer to {% post_link caddy-upgrade-v2-proxy 'this article' %} for upgrade guide.
@ -164,7 +165,7 @@ in {
home = cfg.dataDir;
createHome = true;
};
users.groups.caddyProxy = {
members = [ "caddyProxy" ];
};

View File

@ -46,5 +46,21 @@ if (is_archive()) {
<% if (theme.icons) { %>
<%- css('/libs/forkawesome/css/forkawesome-1.1.7.min.css') %>
<% } %>
<% if (is_post() && page.series) { %>
<%
if (page.series !== 'first' && page.next?.path?.startsWith(`${config.archive_dir}/`)) {
const pageTitle = page.next.title
%>
<%/* page.next is not a typo */%>
<link rel="prev" href="<%- url_for(page.next.path) %>" title="<%= pageTitle %>">
<% } %>
<%
if (page.series !== 'last' && page.prev?.path?.startsWith(`${config.archive_dir}/`)) {
const pageTitle = page.prev.title
%>
<link rel="next" href="<%- url_for(page.prev.path) %>" title="<%= pageTitle %>">
<% } %>
<% } %>
<meta name="yandex-verification" content="e026a03a5dd06730" />
</head>