支持把
{your-theme-name}/templates/*.html
文件,转化为template
进行预览和编译
使用
-
引用公共模板
使用公共
header
和footer
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}}
- 引用公共模板,有助于自定义页面实现统一视觉体验
-
不引用公共模板
使用公共
header
和footer
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}}
- 不引用公共模板,有注意自定义页面保持个性化视觉效果