From 6f081ad91aae0e7ae3d728045f4c3ad81490c557 Mon Sep 17 00:00:00 2001 From: zopiya Date: Mon, 24 Mar 2025 16:16:03 +0800 Subject: [PATCH] Add initial Hugo site configuration and ignore files --- .gitignore | 39 ++++++++++++++++++++ .gitmodules | 3 ++ archetypes/default.md | 5 +++ hugo.toml | 82 +++++++++++++++++++++++++++++++++++++++++++ themes/typo | 1 + 5 files changed, 130 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 archetypes/default.md create mode 100644 hugo.toml create mode 160000 themes/typo diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bac1f30 --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +# Hugo 生成的静态站点目录(一般不提交,用于部署) +/public/ + +# 本地预览时自动生成的资源文件夹 +/resources/_gen/ +assets/jsconfig.json + +# Hugo 缓存文件(模块缓存、临时文件等) +.hugo_build.lock +.hugo_cache/ +.hugo_build/ + +# 操作系统生成的临时文件(Windows, macOS, Linux) +.DS_Store +Thumbs.db +ehthumbs.db +desktop.ini + +# IDE 与编辑器相关文件 +.vscode/ +.idea/ +*.sublime-project +*.sublime-workspace + +# Node.js 相关依赖(如果有使用 npm 管理依赖) +node_modules/ +package-lock.json +yarn.lock + +# 其他临时文件或敏感信息 +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# 临时文件 +*.tmp +*.log diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a7f1553 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/typo"] + path = themes/typo + url = https://github.com/tomfran/typo.git diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..25b6752 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +date = '{{ .Date }}' +draft = true +title = '{{ replace .File.ContentBaseName "-" " " | title }}' ++++ diff --git a/hugo.toml b/hugo.toml new file mode 100644 index 0000000..564e272 --- /dev/null +++ b/hugo.toml @@ -0,0 +1,82 @@ +baseURL = 'https://example.org/' +languageCode = 'en-us' +title = 'My website' +theme = 'typo' + +# Google analytics code +googleAnalytics = "G-xxxxxxxxx" + +[taxonomies] +tag = 'tags' + +[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]] +name = "home" +url = "/" + +[[params.menu]] +name = "posts" +url = "/posts" + +[[params.menu]] +name = "about" +url = "/about" + +# Syntax highlight on code blocks +[markup] +[markup.highlight] +style = 'algol' + +# Giscus comments +[params.giscus] +enable = false +repo = "user/repo" +repoid = "repoId" +category = "General" +categoryid = "categoryId" +mapping = "pathname" +theme = "preferred_color_scheme" diff --git a/themes/typo b/themes/typo new file mode 160000 index 0000000..f7bca2a --- /dev/null +++ b/themes/typo @@ -0,0 +1 @@ +Subproject commit f7bca2a76446f75056279993749eb3311bcc7860