设置笔记类文章隐藏首页和rss

This commit is contained in:
Vaica committed 2026-06-02 09:45:34 +08:00
1 parent 54d905c815
commit dafae2fe1b
5 files changed
+10 -3

No files matched your search

@@ -4,7 +4,7 @@ date: '2026-05-22T00:00:00.000Z'
slug: '202605221646'
draft: false
categories:
- 技术
- 笔记
tags: []
author: 小赵
layout: post
@@ -4,7 +4,7 @@ date: '2026-05-23T00:00:00.000Z'
slug: '202605231938'
draft: false
categories:
- 技术
- 笔记
tags: []
author: 小赵
layout: post
+4 -1
View File
@@ -2,7 +2,10 @@
<div id="pjax-container">
<article>
<div class="post-list section" uk-scrollspy="target: > .post; cls: uk-animation-slide-bottom-small; delay: 100">
{{ $paginator := .Paginate (where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden") }}
{{ $posts := where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden" }}
{{ $exclude := where $posts "Params.categories" "intersect" (slice "笔记") }}
{{ $posts = $posts | complement $exclude }}
{{ $paginator := .Paginate $posts }}
{{ range $paginator.Pages }}
<div class="post">
<div class="time">{{ .Date.Format "January 2, 2006" }}</div>
+2
View File
@@ -4,6 +4,8 @@
{{- $pages = where site.RegularPages "Section" "in" site.Params.mainSections -}}
{{- end }}
{{- $pages = where $pages "Params.hidden" "!=" true -}}
{{- $exclude := where $pages "Params.categories" "intersect" (slice "笔记") -}}
{{- $pages = $pages | complement $exclude -}}
{{- $limit := site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
+2
View File
@@ -36,6 +36,8 @@
<!-- 使用 sort 对文章按 Weight 排序 -->
{{ $posts := sort (where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden")
"Weight" }}
{{ $exclude := where $posts "Params.categories" "intersect" (slice "笔记") }}
{{ $posts = $posts | complement $exclude }}
{{ $paginator := .Paginate $posts }}
{{ range $paginator.Pages }}