1. 增加了几种模板
This commit is contained in:
61
examples/custom-template-demo/layout.json
Normal file
61
examples/custom-template-demo/layout.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"id": "page",
|
||||
"type": "layout",
|
||||
"className": "demo-page",
|
||||
"styles": {
|
||||
"maxWidth": "1100px",
|
||||
"margin": "0 auto",
|
||||
"minHeight": "100vh",
|
||||
"background": "#faf9f5"
|
||||
},
|
||||
"blocks": [
|
||||
{
|
||||
"id": "hdr",
|
||||
"type": "header",
|
||||
"bindings": { "title": "settings.site_title" }
|
||||
},
|
||||
{
|
||||
"id": "navi",
|
||||
"type": "nav",
|
||||
"bindings": {
|
||||
"links": [
|
||||
{ "label": "首页", "href": "/" },
|
||||
{ "label": "博客", "href": "/blog" },
|
||||
{ "label": "作品", "href": "/works" },
|
||||
{ "label": "关于", "href": "/about" }
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "hero1",
|
||||
"type": "hero",
|
||||
"bindings": {
|
||||
"title": "settings.site_title",
|
||||
"subtitle": "settings.site_description",
|
||||
"buttonText": "进入博客",
|
||||
"buttonHref": "/blog"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "div1",
|
||||
"type": "divider"
|
||||
},
|
||||
{
|
||||
"id": "pl",
|
||||
"type": "post_list",
|
||||
"bindings": {
|
||||
"source": "posts",
|
||||
"pageSize": "5",
|
||||
"emptyText": "暂无文章"
|
||||
},
|
||||
"styles": {
|
||||
"padding": "1.5rem"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "ftr",
|
||||
"type": "footer",
|
||||
"bindings": { "text": "settings.footer_icp" }
|
||||
}
|
||||
]
|
||||
}
|
||||
9
examples/custom-template-demo/manifest.json
Normal file
9
examples/custom-template-demo/manifest.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "极简示例",
|
||||
"slug": "minimal-demo",
|
||||
"version": "1.0.0",
|
||||
"type": "custom",
|
||||
"description": "自定义布局包示例:header + 导航 + Hero + 文章列表 + footer",
|
||||
"skin": "skin.css",
|
||||
"layout": "layout.json"
|
||||
}
|
||||
21
examples/custom-template-demo/skin.css
Normal file
21
examples/custom-template-demo/skin.css
Normal file
@@ -0,0 +1,21 @@
|
||||
/* 示例皮肤:仅作用于本模板容器(data-template 隔离) */
|
||||
[data-template="minimal-demo"] .demo-page {
|
||||
font-family: 'Inter', 'Noto Sans SC', sans-serif;
|
||||
color: #1f1f1f;
|
||||
}
|
||||
|
||||
[data-template="minimal-demo"] .demo-page a {
|
||||
color: #b8860b;
|
||||
}
|
||||
|
||||
[data-template="minimal-demo"] .custom-list-item {
|
||||
background: #ffffff;
|
||||
border: 1px solid #eee5d8;
|
||||
border-radius: 10px;
|
||||
margin-bottom: 10px;
|
||||
padding: 1rem 1.2rem;
|
||||
}
|
||||
|
||||
[data-template="minimal-demo"] .custom-list-item:hover {
|
||||
border-color: #b8860b;
|
||||
}
|
||||
Reference in New Issue
Block a user