alinea
v1.0.11
Alinea是現代內容管理系統。
在您的項目目錄中安裝Alinea
npm install alinea初始化Alinea的配置文件
npx alinea init --next打開儀表板,環顧四周
npx alinea dev開始配置類型和字段→
在cms.tsx中配置alinea
import { Config , Field } from 'alinea'
const BlogPost = Config . document ( 'Blog post' , {
fields : {
title : Field . text ( 'Blog entry title' ) ,
body : Field . richText ( 'Body text' )
}
} )
const Blog = Config . document ( 'Blog' , {
contains : [ BlogPost ]
} )類型選項和字段→
根據需要檢索內容充分的量和過濾,訂單,限制。
僅選擇您需要的字段。
import { Query } from 'alinea'
console . log (
await cms . get ( {
type : Blog ,
select : {
title : Blog . title ,
posts : Query . children ( {
type : BlogPost ,
select : {
title : BlogPost . title
}
} )
}
} )
)查看完整的API→
內容在靜態站點生成期間以及服務器端查詢時可用。
內容與您的代碼捆綁在一起,可以用零網絡開銷來查詢。
Alinea如何捆綁內容→
Alinea支持可以作為簡單node.js進程或無服務器運行時間託管的自定義後端。
設置您的後端→
有一個問題還是想法?找到一個錯誤?閱讀如何貢獻。