主题开发规范
EdgePress 开发指南
让内容可以迁移,让主题专注呈现。
主题负责共享布局和页面元素样式。页面文案与媒体归属于站点内容,这样切换主题时不必重写页面。
分开页面内容与视觉呈现
config.yml
content/
pages/home/en.md
assets/images/home-banner.webp
themes/
lumen/
theme.json
layouts/layout.html
layouts/partials/
assets/style.css
将媒体文件放在内容目录
构建无障碍的共享布局
为每个主题设定清晰方向
切换与检查主题
显示单个项目的文章
[
{
"columns": 1,
"cells": [
[
{
"type": "post-list",
"title": "EdgePress articles",
"category": "edgepress",
"count": 6
}
]
]
}
]:root { font-family: var(--edgepress-font-sans); }
h1, h2 { font-family: var(--edgepress-font-serif); }
pre, code { font-family: var(--edgepress-font-mono); }
!document[年度报告](/documents/report.docx)
!document[共享 PDF](https://files.example/download/123){format=pdf service=documents}
[
{
"type": "document",
"title": "年度报告",
"src": "/documents/report.xlsx"
}
][
{
"columns": 1,
"cells": [
[
{
"type": "document",
"title": "Report",
"src": "/documents/report.pdf"
},
{
"type": "media-viewer",
"title": "Photos and video",
"items": [
{
"type": "image",
"src": "/images/photo.webp",
"originalSrc": "/images/photo-original.webp",
"alt": "Detail of the project interface"
},
{
"type": "video",
"src": "/videos/walkthrough.mp4",
"poster": "/images/poster.webp",
"label": "Project walkthrough",
"captions": "/videos/walkthrough.en.vtt",
"captionLanguage": "en"
}
]
}
]
]
}
]