mirror of
https://github.com/zopiya/blog.git
synced 2025-11-03 12:16:46 +08:00
Update Hugo configuration and .gitignore for improved site structure and SEO settings
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
# Hugo 生成的静态站点目录(一般不提交,用于部署)
|
# Hugo 生成的静态站点目录(一般不提交,用于部署)
|
||||||
/public/
|
/public/
|
||||||
|
/content/
|
||||||
|
|
||||||
# 本地预览时自动生成的资源文件夹
|
# 本地预览时自动生成的资源文件夹
|
||||||
/resources/_gen/
|
/resources/_gen/
|
||||||
|
|||||||
191
hugo.toml
191
hugo.toml
@@ -1,82 +1,139 @@
|
|||||||
baseURL = 'https://example.org/'
|
# 网站基本信息
|
||||||
languageCode = 'en-us'
|
baseURL = "https://blog.7wate.com/" # 请替换为你的实际域名
|
||||||
title = 'My website'
|
languageCode = "zh-cn"
|
||||||
theme = 'typo'
|
title = "向阳而生"
|
||||||
|
theme = "typo"
|
||||||
|
defaultContentLanguage = "zh-cn"
|
||||||
|
hasCJKLanguage = true
|
||||||
|
enableEmoji = true
|
||||||
|
canonifyURLs = true
|
||||||
|
|
||||||
# Google analytics code
|
# SEO & 分析
|
||||||
googleAnalytics = "G-xxxxxxxxx"
|
googleAnalytics = "xxx" # 生产环境请填入 G-XXXXXX
|
||||||
|
enableRobotsTXT = true
|
||||||
|
|
||||||
|
# 构建性能
|
||||||
|
timeout = "300s"
|
||||||
|
|
||||||
|
# 永久链接结构
|
||||||
|
[permalinks]
|
||||||
|
posts = "/posts/:year/:month/:day/:slug/"
|
||||||
|
|
||||||
|
# 自定义分类标签
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tag = 'tags'
|
tag = "tags"
|
||||||
|
category = "categories"
|
||||||
|
series = "series"
|
||||||
|
|
||||||
[params]
|
|
||||||
# Meta description
|
|
||||||
description = "A Tech Blog"
|
|
||||||
|
|
||||||
# Appearance settings
|
# 菜单设置
|
||||||
theme = 'auto'
|
|
||||||
colorPalette = 'default'
|
|
||||||
hideHeader = false
|
|
||||||
|
|
||||||
# Intro on main page, content is markdown
|
|
||||||
homeIntroTitle = 'Hi!'
|
|
||||||
homeIntroContent = """
|
|
||||||
I am an Italian Software Engineer with a strong foundation in computer science and a passion for solving complex problems.
|
|
||||||
I am interested in a range of topics, including algorithms, distributed systems, databases, and information retrieval.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Collection to display on home
|
|
||||||
homeCollectionTitle = 'Posts'
|
|
||||||
homeCollection = 'posts'
|
|
||||||
|
|
||||||
# Lists parameters
|
|
||||||
paginationSize = 100
|
|
||||||
listSummaries = true
|
|
||||||
listDateFormat = '2 Jan 2006'
|
|
||||||
|
|
||||||
# Breadcrumbs
|
|
||||||
[params.breadcrumbs]
|
|
||||||
enabled = true
|
|
||||||
showCurrentPage = true
|
|
||||||
home = "Home"
|
|
||||||
|
|
||||||
# Social icons
|
|
||||||
[[params.social]]
|
|
||||||
name = "linkedin"
|
|
||||||
url = "https://www.linkedin.com/in/user/"
|
|
||||||
|
|
||||||
[[params.social]]
|
|
||||||
name = "medium"
|
|
||||||
url = "https://medium.com/@user"
|
|
||||||
|
|
||||||
[[params.social]]
|
|
||||||
name = "github"
|
|
||||||
url = "https://github.com/user"
|
|
||||||
|
|
||||||
# Main menu pages
|
|
||||||
[[params.menu]]
|
[[params.menu]]
|
||||||
name = "home"
|
name = "首页"
|
||||||
url = "/"
|
url = "/"
|
||||||
|
|
||||||
[[params.menu]]
|
[[params.menu]]
|
||||||
name = "posts"
|
name = "文辑"
|
||||||
url = "/posts"
|
url = "/posts/"
|
||||||
|
|
||||||
|
[[params.menu]]
|
||||||
|
name = "片语"
|
||||||
|
url = "/memos/"
|
||||||
|
newTab = true
|
||||||
|
|
||||||
|
[[params.menu]]
|
||||||
|
name = "挚友"
|
||||||
|
url = "/friend/"
|
||||||
|
newTab = true
|
||||||
|
|
||||||
[[params.menu]]
|
[[params.menu]]
|
||||||
name = "about"
|
name = "about"
|
||||||
url = "/about"
|
url = "/about/"
|
||||||
|
newTab = true
|
||||||
|
|
||||||
# Syntax highlight on code blocks
|
# Typo 主题参数
|
||||||
|
[params]
|
||||||
|
description = "一个喜欢异想天开的家伙 💨"
|
||||||
|
theme = "auto"
|
||||||
|
colorPalette = "default"
|
||||||
|
hideHeader = true
|
||||||
|
|
||||||
|
# 首页设置
|
||||||
|
homeIntroTitle = "👋👋👋"
|
||||||
|
homeIntroContent = """
|
||||||
|
一个喜欢异想天开的家伙 💨
|
||||||
|
"""
|
||||||
|
|
||||||
|
homeCollectionTitle = "文辑"
|
||||||
|
homeCollection = "posts"
|
||||||
|
|
||||||
|
paginationSize = 7
|
||||||
|
listSummaries = false
|
||||||
|
listDateFormat = "2 Jan"
|
||||||
|
|
||||||
|
# 页脚设置
|
||||||
|
showFooter = true
|
||||||
|
footerContent = "Your **custom** md `footer`"
|
||||||
|
|
||||||
|
# 面包屑导航
|
||||||
|
[params.breadcrumbs]
|
||||||
|
enabled = true
|
||||||
|
showCurrentPage = true
|
||||||
|
home = "首页"
|
||||||
|
|
||||||
|
# Favicon / Logo / SEO 元数据(可选)
|
||||||
|
# params.logo = "/images/logo.png"
|
||||||
|
# params.favicon = "/favicon.ico"
|
||||||
|
# params.keywords = ["技术博客", "分布式系统", "编程", "数据库"]
|
||||||
|
|
||||||
|
# 社交链接
|
||||||
|
# [[params.social]]
|
||||||
|
# name = "github"
|
||||||
|
# url = "https://github.com/yourusername"
|
||||||
|
|
||||||
|
# [[params.social]]
|
||||||
|
# name = "linkedin"
|
||||||
|
# url = "https://www.linkedin.com/in/yourprofile/"
|
||||||
|
|
||||||
|
# [[params.social]]
|
||||||
|
# name = "medium"
|
||||||
|
# url = "https://medium.com/@yourusername"
|
||||||
|
|
||||||
|
# Markdown 与高亮设置
|
||||||
[markup]
|
[markup]
|
||||||
[markup.highlight]
|
[markup.highlight]
|
||||||
style = 'algol'
|
style = "algol"
|
||||||
|
lineNos = true
|
||||||
|
lineNumbersInTable = true
|
||||||
|
noClasses = false
|
||||||
|
|
||||||
# Giscus comments
|
[markup.goldmark.renderer]
|
||||||
[params.giscus]
|
unsafe = false # 更安全,建议通过短代码插入 HTML,而不是直接 HTML
|
||||||
enable = false
|
|
||||||
repo = "user/repo"
|
# 安全设置
|
||||||
repoid = "repoId"
|
[security]
|
||||||
category = "General"
|
enableInlineShortcodes = true
|
||||||
categoryid = "categoryId"
|
|
||||||
mapping = "pathname"
|
# 站点地图(SEO)
|
||||||
theme = "preferred_color_scheme"
|
[sitemap]
|
||||||
|
changefreq = "weekly"
|
||||||
|
priority = 0.5
|
||||||
|
filename = "sitemap.xml"
|
||||||
|
|
||||||
|
# 隐私与 GDPR
|
||||||
|
[privacy]
|
||||||
|
[privacy.googleAnalytics]
|
||||||
|
anonymizeIP = true
|
||||||
|
respectDoNotTrack = true
|
||||||
|
useSessionStorage = false
|
||||||
|
disable = false
|
||||||
|
|
||||||
|
# 构建压缩设置
|
||||||
|
[minify]
|
||||||
|
minifyOutput = true
|
||||||
|
|
||||||
|
# 针对不同构建环境的配置(可选)
|
||||||
|
[environment.production]
|
||||||
|
minifyOutput = true
|
||||||
|
|
||||||
|
[environment.development]
|
||||||
|
minifyOutput = false
|
||||||
|
|||||||
Reference in New Issue
Block a user