跳到主要内容

Hugo Puppet 主题搭建教程

· 阅读需 4 分钟
ahKevinXy

配置参数


# 配置基础路径 默认可以配置 (必须配置你对应的github page 地址 如果是默认github page 地址 设置 / 即可)
baseURL = "https://ahkevinxy.github.io/hugo-theme-puppet"

# 标题名称 页面为设置 title 会显示
title = "ahKevinXy"
# 主题配置
theme = "puppet"
canonifyurls = true


copyright = ""
paginate = 3
languageCode = "en"
defaultContentLanguage = "en"

hasCJKLanguage = true
enableInlineShortcodes = true
enableEmoji = true
# prevent build failures when using Hugo's Instagram shortcode due to deprecated Instagram API.
# See https://github.com/gohugoio/hugo/issues/7228#issuecomment-714490456
ignoreErrors = ["error-remote-getjson"]

disqusShortname = ""
googleAnalytics = ""

[outputs]
home = ["HTML", "JSON", "RSS"]

# prevent build failures when using Hugo's template _internal/opengraph.html
[taxonomies]
category = "categories"
tag = "tags"
series = "series"

# markdown 语法配置
[markup]
[markup.highlight]
noClasses = true
codeFences = true
guessSyntax = true
lineNos = true
lineNumbersInTable = false
style = "dracula"

[markup.goldmark.renderer]
unsafe = true

# 菜单设置
[menu]
[[menu.main]]
identifier = "home" # 提示
name = "home" # 显示名称
url = "/" # 链接地址 可以外链
weight = -100 # 权重 越小越靠左
[[menu.main]]
identifier = "research"
name = "research"
url = "/research/"
weight = 10
[[menu.main]]
identifier = "publications"
name = "publications"
url = "/publications/"
weight = 20
[[menu.main]]
identifier = "members"
name = "members"
url = "/members/"
weight = 30
[[menu.main]]
identifier = "contract"
name = "contract"
url = "/contract/"
weight = 50

[[menu.main]]
identifier = "opportunities"
name = "opportunities"
url = "/opportunities/"
weight = 60

[[menu.main]]
identifier = "news"
name = "news"
url = "/news/"
weight = 100




[params]
author = "ahKevinXy"
description = ""
keywords = "blog,developer,personal"
img_home = "img/home-bg.jpg"
img_404 = "img/404-bg.jpg"

useFaviconGenerator = true

# 自定义主题时候使用
custom_js = []
custom_css = [] # ["css/custom.css"] Add your file to assets folder [assets/css/custom.css]

# 侧边栏配置
[params.sidebar]
enable = false # 是否显示
gravatarEmail = "" # 个人邮箱
# Overwritten by your gravatar image if `gravatarEmail` is filled
avatar = "img/home-bg.jpg" # 头像
bio = "lab website" # 个人简介

# 个人社交信息
#[params.social]
#twitter = "johndoe"
#facebook = "johndoe"
#zhihu = "johndoe"
#weibo = "johndoe"
#github = "johndoe"
#gitlab = "johndoe"
#linkedin = "johndoe"
# rss = true
#[params.social.mastodon]
#weight = 56
#icon = "fab fa-mastodon"
#format = "https://mastodon.social/%v"
#id = "johndoe"
#url = ""

# 友链配置
#[[params.friends]]
#name = "John Doe"
#url = "https://gohugo.io"

#[[params.friends]]
#name = "John Doe"
#url = "https://gohugo.io"

# See https://giscus.app/
# 评论 giscus 配置
#[params.giscus]
#enable = true
#repo = "roninro/hugo-theme-puppet"
#repo_id = "R_kgDOHuvyhw"
#category = "General"
#category_id = "DIC_kwDOHuvyh84CQjDo"
#input_position = "top"
#theme = "light_tritanopia"
#lang = "en"


页面配置

---
title : "Contact Us" # 标题 为空显示默认 title 不想显示` `即可
header_img: "https://source.unsplash.com/random?people&63" # 头部背景图片
date: "2019-02-28" // 日期
author: "ahKevinXy" // 作者
---

目录介绍

页面对应目录 content/

├── _index.md  // 首页
├── about
│ └── _index.md //关于页面
├── archive // 归档页面
│ └── _index.md
├── contract // 联系页面
│ └── _index.md
├── members // 成员名称
│ └── _index.md
├── news // 新闻
│ └── _index.md
├── opportunities //机会
│ └── _index.md
├── publications // 出版物
│ └── _index.md
└── research //研究
└── _index.md

对应目录修改

_index.md