wip(search): add index.json

This commit is contained in:
geekifan
2025-04-26 12:40:11 +08:00
parent 7f26f327fb
commit 7399c4f7a1
2 changed files with 27 additions and 0 deletions

View File

@ -4,6 +4,28 @@ title = 'Chirpy'
enableGitInfo = true enableGitInfo = true
paginate = 5 # 每页显示的文章数量 paginate = 5 # 每页显示的文章数量
[outputs]
home = ["HTML", "RSS", "JSON"]
[markup.highlight]
anchorLineNos = false
codeFences = true
guessSyntax = true
hl_Lines = ''
hl_inline = false
lineAnchors = ''
lineNoStart = 1
lineNos = true
lineNumbersInTable = true
noClasses = false
tabWidth = 4
wrapperClass = 'highlight'
[markup.goldmark.parser.attribute]
block = true
title = true
[markup.goldmark.renderer]
unsafe = true
[taxonomies] [taxonomies]
category = "categories" category = "categories"
tag = "tags" tag = "tags"

View File

@ -0,0 +1,5 @@
{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .Permalink) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}