feat: ui overhaul (#676)

This commit is contained in:
Daniel Lautzenheiser
2023-03-30 13:29:09 -04:00
committed by GitHub
parent 5c86462859
commit 66b81e9228
385 changed files with 20607 additions and 16493 deletions

View File

@ -3,6 +3,19 @@ backend:
site_url: 'https://staticcms.org/'
media_folder: assets/uploads
locale: en
i18n:
# Required and can be one of multiple_folders, multiple_files or single_file
# multiple_folders - persists files in `<folder>/<locale>/<slug>.<extension>`
# multiple_files - persists files in `<folder>/<slug>.<locale>.<extension>`
# single_file - persists a single file in `<folder>/<slug>.<extension>`
structure: multiple_files
# Required - a list of locales to show in the editor UI
locales: [en, de, fr]
# Optional, defaults to the first item in locales.
# The locale to be used for fields validation and as a baseline for the entry.
defaultLocale: en
collections:
- name: posts
label: Posts
@ -12,7 +25,10 @@ collections:
and editing guidelines that are specific to a collection.
folder: _posts
slug: '{{year}}-{{month}}-{{day}}-{{slug}}'
summary: '{{title}} -- {{year}}/{{month}}/{{day}}'
summary_fields:
- title
- date
- draft
sortable_fields:
fields:
- title
@ -206,7 +222,7 @@ collections:
time_format: 'h:mm aaa'
required: false
- name: date_and_time_with_default
label: Date and Time With Deafult
label: Date and Time With Default
widget: datetime
format: 'MMM d, yyyy h:mm aaa'
date_format: 'MMM d, yyyy'
@ -217,25 +233,28 @@ collections:
label: Date
widget: datetime
format: 'MMM d, yyyy'
date_format: 'MMM d, yyyy'
time_format: false
required: false
- name: date_with_default
label: Date With Deafult
label: Date With Default
widget: datetime
format: 'MMM d, yyyy'
date_format: 'MMM d, yyyy'
time_format: false
required: false
default: 'Jan 12, 2023'
- name: time
label: Time
widget: datetime
format: 'h:mm aaa'
date_format: false
time_format: 'h:mm aaa'
required: false
- name: time_with_default
label: Time With Deafult
label: Time With Default
widget: datetime
format: 'h:mm aaa'
date_format: false
time_format: 'h:mm aaa'
required: false
default: '12:00 am'
@ -593,6 +612,27 @@ collections:
name: thumb
widget: image
required: false
- label: Collapsed, optional with required children
name: collapsed_optional_with_required_children
widget: object
required: false
collapsed: true
fields:
- name: layout
widget: hidden
default: post
- label: Number of posts on frontpage
name: front_limit
widget: number
required: true
- label: Author
name: author
widget: string
required: true
- label: Thumbnail
name: thumb
widget: image
required: true
- name: relation
label: Relation
file: _widgets/relation.json
@ -607,7 +647,7 @@ collections:
- date
search_fields:
- title
- body
- date
value_field: title
- label: Required With Default
name: with_default
@ -618,7 +658,7 @@ collections:
- date
search_fields:
- title
- body
- date
value_field: title
default: This is a YAML front matter post
- label: Optional Validation
@ -631,7 +671,7 @@ collections:
- date
search_fields:
- title
- body
- date
value_field: title
- label: Multiple
name: multiple
@ -644,7 +684,7 @@ collections:
- date
search_fields:
- title
- body
- date
value_field: title
- label: Multiple With Default
name: multiple_with_default
@ -660,7 +700,7 @@ collections:
- date
search_fields:
- title
- body
- date
value_field: title
- name: select
label: Select
@ -1188,3 +1228,24 @@ collections:
- label: File
name: file
widget: file
- name: i18n_playground
label: i18n Playground
i18n: true
folder: _i18n_playground
identifier_field: slug
create: true
fields:
# The slug field will be omitted from the translation.
- name: slug
label: Slug
widget: string
# same as 'i18n: translate'. Allows translation of the description field
- name: description
label: Description
widget: text
i18n: true
# The date field will be duplicated from the default locale.
- name: date
label: Date
widget: datetime
i18n: duplicate