主題開發規範
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"
}
]
}
]
]
}
]