Add Chinese i18n and SEO settings, customize home layout
This commit is contained in:
@@ -51,26 +51,45 @@ menu:
|
|||||||
type: search
|
type: search
|
||||||
|
|
||||||
params:
|
params:
|
||||||
|
# SEO
|
||||||
description: 一只爪子的技术笔记与生活记录
|
description: 一只爪子的技术笔记与生活记录
|
||||||
|
images:
|
||||||
|
- /images/logo.svg
|
||||||
|
|
||||||
|
# Favicon 路径
|
||||||
|
favicon:
|
||||||
|
dark: /images/logo-dark.svg
|
||||||
|
light: /images/logo.svg
|
||||||
|
|
||||||
|
# 导航栏
|
||||||
navbar:
|
navbar:
|
||||||
displayTitle: true
|
displayTitle: true
|
||||||
displayLogo: false
|
displayLogo: false
|
||||||
width: wide
|
width: wide
|
||||||
|
# logo:
|
||||||
|
# path: /images/logo.svg
|
||||||
|
# dark: /images/logo-dark.svg
|
||||||
|
# link: /
|
||||||
|
# width: 32
|
||||||
|
# height: 32
|
||||||
|
|
||||||
|
# 主题
|
||||||
theme:
|
theme:
|
||||||
default: system
|
default: system
|
||||||
displayToggle: true
|
displayToggle: true
|
||||||
|
|
||||||
|
# 页脚
|
||||||
footer:
|
footer:
|
||||||
enable: true
|
enable: true
|
||||||
displayCopyright: true
|
displayCopyright: true
|
||||||
displayPoweredBy: false
|
displayPoweredBy: false
|
||||||
width: normal
|
width: normal
|
||||||
|
|
||||||
|
# 日期
|
||||||
displayUpdatedDate: false
|
displayUpdatedDate: false
|
||||||
dateFormat: "2006-01-02"
|
dateFormat: "2006-01-02"
|
||||||
|
|
||||||
|
# 搜索
|
||||||
search:
|
search:
|
||||||
enable: true
|
enable: true
|
||||||
type: flexsearch
|
type: flexsearch
|
||||||
@@ -78,20 +97,51 @@ params:
|
|||||||
index: content
|
index: content
|
||||||
tokenize: forward
|
tokenize: forward
|
||||||
|
|
||||||
|
# 博客
|
||||||
blog:
|
blog:
|
||||||
list:
|
list:
|
||||||
displayTags: true
|
displayTags: true
|
||||||
sortBy: date
|
sortBy: date
|
||||||
sortOrder: desc
|
sortOrder: desc
|
||||||
pagerSize: 20
|
pagerSize: 10
|
||||||
|
displayDate: true
|
||||||
|
displaySummary: true
|
||||||
article:
|
article:
|
||||||
displayPagination: true
|
displayPagination: true
|
||||||
|
displayReadMore: true
|
||||||
|
|
||||||
|
# 目录
|
||||||
toc:
|
toc:
|
||||||
displayTags: true
|
displayTags: true
|
||||||
|
|
||||||
|
# 页面
|
||||||
page:
|
page:
|
||||||
width: normal
|
width: normal
|
||||||
|
|
||||||
|
# 评论 (关闭)
|
||||||
comments:
|
comments:
|
||||||
enable: false
|
enable: false
|
||||||
|
# type: giscus
|
||||||
|
# giscus:
|
||||||
|
# repo: your/repo
|
||||||
|
# repoId: xxx
|
||||||
|
# category: General
|
||||||
|
# categoryId: xxx
|
||||||
|
|
||||||
|
# RSS 定制
|
||||||
|
rss:
|
||||||
|
limit: 20
|
||||||
|
|
||||||
|
# 代码高亮增强
|
||||||
|
highlight:
|
||||||
|
copy:
|
||||||
|
enable: true
|
||||||
|
lineNumbers: false
|
||||||
|
|
||||||
|
# Open Graph / SEO 增强
|
||||||
|
opengraph:
|
||||||
|
enable: true
|
||||||
|
|
||||||
|
# Schema.org 结构化数据
|
||||||
|
schema:
|
||||||
|
enable: true
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# 覆盖 Hextra 主题默认文案
|
||||||
|
copyright: "© 2026 爪子笔记"
|
||||||
|
poweredBy: ""
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
{{ define "main" }}
|
||||||
|
<div class="hx:mx-auto hx:flex hextra-max-page-width">
|
||||||
|
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true) }}
|
||||||
|
<main
|
||||||
|
id="content"
|
||||||
|
class="hx:w-full hx:break-words hx:min-h-[calc(100vh-var(--navbar-height))] hx:min-w-0 hx:pb-8 hx:pt-8 hx:md:pt-12 hx:pl-[max(env(safe-area-inset-left),1.5rem)] hx:pr-[max(env(safe-area-inset-left),1.5rem)]"
|
||||||
|
>
|
||||||
|
<div class="hx:flex hx:flex-col hx:items-start">{{ .Content }}</div>
|
||||||
|
|
||||||
|
{{- $pages := where .Site.RegularPages "Section" "blog" }} {{- $pages =
|
||||||
|
$pages.ByDate.Reverse }} {{- $recent := first 6 $pages }} {{- $readMore
|
||||||
|
:= (T "readMore") | default "Read more →" }}
|
||||||
|
|
||||||
|
<div class="hx:mt-16">
|
||||||
|
<h2
|
||||||
|
class="hx:text-2xl hx:font-bold hx:tracking-tight hx:text-slate-900 hx:dark:text-slate-100 hx:mb-6"
|
||||||
|
>
|
||||||
|
📝 最新文章
|
||||||
|
</h2>
|
||||||
|
{{- range $recent }}
|
||||||
|
<div class="hx:mb-8">
|
||||||
|
<h3>
|
||||||
|
<a
|
||||||
|
style="color: inherit; text-decoration: none"
|
||||||
|
class="hx:block hx:font-semibold hx:text-xl hx:hover:text-primary-600 hx:dark:hover:text-primary-400 hx:transition-colors"
|
||||||
|
href="{{ .RelPermalink }}"
|
||||||
|
>{{ .Title }}</a
|
||||||
|
>
|
||||||
|
</h3>
|
||||||
|
{{- if site.Params.blog.list.displayTags }}
|
||||||
|
<div class="hx:text-sm hx:leading-7">
|
||||||
|
{{ partial "tags.html" (dict "context" .) }}
|
||||||
|
</div>
|
||||||
|
{{- end }}
|
||||||
|
<p class="hx:opacity-80 hx:mt-2 hx:leading-7">
|
||||||
|
{{- partial "utils/page-description" . -}}
|
||||||
|
</p>
|
||||||
|
<p class="hx:opacity-50 hx:text-sm hx:mt-2 hx:leading-7">
|
||||||
|
{{ partial "utils/format-date" .Date }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{{- end }} {{- if gt (len $pages) 6 }}
|
||||||
|
<p class="hx:mt-6">
|
||||||
|
<a
|
||||||
|
href="/blog"
|
||||||
|
class="hx:font-medium hx:text-primary-600 hx:hover:text-primary-700 hx:dark:text-primary-400"
|
||||||
|
>
|
||||||
|
{{ $readMore }}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
{{- end }}
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
Reference in New Issue
Block a user