新建自定义页面

2021-01-01

支持把{your-theme-name}/templates/*.html文件,转化为template进行预览和编译

使用


  1. 引用公共模板

    使用公共headerfooter

     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	</head>
    10	<body>
    11		{{template "header" .}}
    12
    13		<main>write-you-customize-code-here</main>
    14
    15		{{template "footer" .}}
    16	</body>
    17</html>
    18{{end}}
    
    • 引用公共模板,有助于自定义页面实现统一视觉体验
  2. 不引用公共模板

    使用公共headerfooter

     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	</head>
    10	<body>
    11		<main>write-you-customize-code-here</main>
    12	</body>
    13</html>
    14{{end}}
    
    • 不引用公共模板,有注意自定义页面保持个性化视觉效果

更多


  • template名称不可重复

  • 可通过自定义页面,配置自定义页面访问地址

  • 可使用action,配置自定义页面调用动态数据