转载翻译自: https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-features/
作者:PaperMod Authors
已获得作者授权
中文demo
https://note.ftls.xyz/papermod/
介绍
-
我们将在下面的所有示例中使用
yml/yaml
格式,我建议使用yml
而不是toml
,因为它更易于阅读。 -
如果你需要,你可以找 YML to TOML 这类转换器。
Assets (js/css)
以下是默认启用的
- minification - makes the assets size smallest as possible.
- bundling - bundles all the styles in one single asset
- fingerprint/integrity check.
默认主题亮/暗/自动
params:
# defaultTheme: light
# defaultTheme: dark
defaultTheme: auto # to switch between dark or light according to browser theme
主题切换切换(默认启用)
在页面标题之外显示图标以更改主题
禁用方法:
disableThemeToggle: true
您可以参考下表以更好地理解…
defaultTheme |
disableThemeToggle |
checks local storage? | checks system theme? | Info |
---|---|---|---|---|
auto |
true | No | Yes | only system theme |
false | Yes (if not->2) | Yes (2) | switch present | |
dark |
true | No | No | force dark only |
false | Yes | No | switch present | |
light |
true | No | No | force light only |
false | Yes | No | switch present |
归档布局 Archives Layout
在content
目录中创建一个带有archive.md
的页面,内容如下
.
├── config.yml
├── content/
│ ├── archives.md <--- Create archive.md here
│ └── posts/
├── static/
└── themes/
└── PaperMod/
并添加以下内容
---
title: "Archive"
layout: "archives"
url: "/archives/"
summary: archives
---
注意: Archives Layout不支持多语言月份翻译。
如: archives.md
主页模式 Regular Mode (default-mode)
主页模式 Home-Info Mode
使用第一个条目作为一些显示信息
将以下内容添加到配置文件中
params:
homeInfoParams:
Title: Hi there wave
Content: Can be Info, links, about...
socialIcons: