配色设置

2021-01-01

该项为可选置项,map类型,可将模板的color(background, font)信息提取至配置文件

在主题目录 theme.toml,可配置该项

配置


1[theme.color]
2background = "bg-cyan-700"
3font = "text-white"

Notice

  • 该项为字典类型,支持配置多个非重名[name]配置项

  • 该项所定义内容,在任意模板页均可使用

  • 该内容仅为使用方法举例,用户可基于toml语法,进行自定义配置

释义


  1. background

    设置站点background(背景颜色)信息

  2. font

    设置站点font(字体颜色)信息

使用

  • 使用 color

     1{{define you-template-name}}
     2<!DOCTYPE html>
     3<html lang="en">
     4	<head>
     5		<meta charset="UTF-8" />
     6		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
     7		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
     8		<title>Document</title>
     9		<link rel="stylesheet" href="/assets/css/output.css" />
    10	</head>
    11	<body>
    12		<main>write-you-customize-code-here</main>
    13		<footer class="{{.Theme.color.background}} {{.Theme.color.font}}">
    14			<p>{{.Theme.copyright}}</p>
    15		</footer>
    16	</body>
    17</html>
    18{{end}}