Collection views
view controls how a collection's entries are listed. Without it, SP CMS lists each entry by its primary field.
- name: posts
type: collection
path: src/content/posts
view:
fields: [title, author.name, date, draft]
primary: title
sort: [date, title]
search: [title, tags]
default:
sort: date
order: descKeys
Tree layout
For content kept in nested folders, such as documentation, layout: tree shows entries as an expandable tree. Each folder is represented by a node file inside it:
view:
layout: tree
node:
filename: index.md
hideDirs: nodesfilename: the file that represents its folder, such asindex.md.hideDirs: hide folders that have a node file (nodes), folders that don't (others), orall.
node: index.md is shorthand for { filename: index.md, hideDirs: nodes }.