feat: nested collections (#680)
This commit is contained in:
committed by
GitHub
parent
22a1b8d9c0
commit
d0ecae310c
@ -1249,3 +1249,22 @@ collections:
|
||||
label: Date
|
||||
widget: datetime
|
||||
i18n: duplicate
|
||||
- name: pages
|
||||
label: Nested Pages
|
||||
label_singular: 'Page'
|
||||
folder: _nested_pages
|
||||
create: true
|
||||
# adding a nested object will show the collection folder structure
|
||||
nested:
|
||||
depth: 100 # max depth to show in the collection tree
|
||||
summary: '{{title}}' # optional summary for a tree node, defaults to the inferred title field
|
||||
# adding a path object allows editing the path of entries
|
||||
# moving an existing entry will move the entire sub tree of the entry to the new location
|
||||
path: { label: 'Path', index_file: 'index' }
|
||||
fields:
|
||||
- label: Title
|
||||
name: title
|
||||
widget: string
|
||||
- label: Body
|
||||
name: body
|
||||
widget: markdown
|
||||
|
@ -134,6 +134,32 @@
|
||||
"---\ndescription: Le café est un petit arbre ou un arbuste qui pousse dans le sous-étage de la forêt sous sa forme sauvage et qui était traditionnellement cultivé commercialement sous d'autres arbres qui fournissaient de l'ombre. La structure forestière des plantations de café d'ombre fournit un habitat à un grand nombre d'espèces migratrices et résidentes.\ndate: 2015-02-14T00:00:00.000Z\n---\n",
|
||||
},
|
||||
},
|
||||
_nested_pages: {
|
||||
authors: {
|
||||
'author-1': {
|
||||
'index.md': {
|
||||
content: '---\ntitle: An Author\n---\nAuthor details go here!.\n',
|
||||
},
|
||||
},
|
||||
'index.md': {
|
||||
content: '---\ntitle: Authors\n---\n',
|
||||
},
|
||||
},
|
||||
posts: {
|
||||
'hello-world': {
|
||||
'index.md': {
|
||||
content:
|
||||
'---\ntitle: Hello World\n---\nCoffee is a small tree or shrub that grows in the forest understory in its wild form, and traditionally was grown commercially under other trees that provided shade. The forest-like structure of shade coffee farms provides habitat for a great number of migratory and resident species.\n',
|
||||
},
|
||||
},
|
||||
'index.md': {
|
||||
content: '---\ntitle: Posts\n---\n',
|
||||
},
|
||||
},
|
||||
'index.md': {
|
||||
content: '---\ntitle: Pages\n---\n',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
var ONE_DAY = 60 * 60 * 24 * 1000;
|
||||
|
Reference in New Issue
Block a user