# yaml-language-server: $schema=https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json

backend:
  name: gitlab
  repo: ChlorideCull/chcl.se

media_folder: /assets
public_folder: /assets

slug:
  encoding: ascii
  clean_accents: true

output:
  omit_empty_optional_fields: true

collections:
  - name: posts
    label: Posts
    label_singular: Post
    folder: /_posts
    icon: post
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    media_folder: "/assets/postimg/{{slug}}"
    fields:
      - name: layout
        widget: hidden
        default: "post"
      - label: Title
        name: title
        widget: string
        required: true
      - label: Date
        name: date
        widget: datetime
        type: "datetime-local"
        output_utc: true
        required: true
      - label: Last modified
        name: last_modified_at
        widget: datetime
        type: "datetime-local"
        output_utc: true
        required: false
      - label: Tags
        name: tags
        widget: list
        required: false
      - label: Body
        name: body
        widget: richtext
        required: true
  
  - name: draft
    label: Drafts
    label_singular: Draft
    folder: /_drafts
    icon: post
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    media_folder: "/assets/postimg/{{slug}}"
    fields:
      - name: layout
        widget: hidden
        default: "post"
      - label: Title
        name: title
        widget: string
        required: true
      - label: Date
        name: date
        widget: datetime
        type: "datetime-local"
        output_utc: true
        required: false
      - label: Last modified
        name: last_modified_at
        widget: datetime
        type: "datetime-local"
        output_utc: true
        required: false
      - label: Tags
        name: tags
        widget: list
        required: false
      - label: Body
        name: body
        widget: richtext
        required: true

  - name: artists
    label: Artists
    folder: /_artists
    slug: "{{title | lower}}"
    duplicate: false
    icon: brush
    fields:
      - name: title
        label: Name
        widget: string
        required: true
      - name: site
        label: Site
        widget: string
        required: true

  - name: artwork
    label: Artwork
    folder: /_artwork
    slug: "{{artist}}-{{slug}}"
    media_folder: ""
    public_folder: ""
    create: false
    delete: false
    icon: wall_art
    fields:
      - name: title
        label: Title
        widget: string
        required: true
      - name: author
        label: Artist
        widget: relation
        collection: artists
        value_field: title
      - label: Date
        name: date
        widget: datetime
        type: "date"
        required: true
      - name: desc
        label: Description
        widget: string
        required: false
      - label: Categories
        name: categories
        widget: select
        options: 
          - safe
          - fat
          - kinktimate
          - nsfw
        default: safe
        multiple: true
        required: true
        min: 1
      - label: Commentary
        name: body
        widget: richtext
        required: false

  - name: pages
    label: Pages
    folder: /_xpages
    icon: article
    fields:
      - widget: select
        options:
          - page
          - post
          - default
        name: layout
        label: Layout
      - widget: string
        name: permalink
        label: Permalink Override
        required: false
      - widget: string
        name: custom_class
        label: Custom content CSS class
        required: false
      - label: Date
        name: date
        widget: datetime
        type: "datetime-local"
        output_utc: true
        required: false
      - label: Last modified
        name: last_modified_at
        widget: datetime
        type: "datetime-local"
        output_utc: true
        required: false
      - name: body
        label: Body
        widget: richtext
  
  - name: headmates
    label: Headmates
    folder: /_headmates
    icon: person
    identifier_field: name
    fields:
      - name: name
        label: Name
        widget: string
      - name: pronouns
        label: Pronouns
        widget: string
      - name: species
        label: Species
        widget: string
      - name: image
        label: Headshot
        widget: image
        media_folder: "/assets/headshots"
      - name: image_author
        label: Image Artist
        widget: string
      - name: image_author_link
        label: Image Artist Link
        widget: string
      - name: ref
        label: Reference
        widget: relation
        collection: artwork
      - name: colors
        label: Colors
        widget: list
        field:
          name: color
          label: Color
          widget: color
        required: false
      - name: body
        label: Biography
        widget: richtext

singletons:
  - name: index
    label: Home
    file: /index.md
    fields:
      - name: layout
        widget: hidden
        default: "home"
      - name: custom_class
        widget: hidden
        default: "home_content"
      - name: external_links
        widget: list
        fields:
          - name: url
            label: URL
            widget: string
          - name: title
            label: Title
            widget: string
          - name: text
            label: Text
            widget: string
            prefix: " "
          - name: attributes
            label: Link Attributes
            widget: string
            required: false
      - name: body
        label: Body
        widget: richtext

  - name: buttons
    label: Buttons
    file: /_data/buttons.yml
    fields:
      - widget: list
        name: buttons
        fields:
          - name: name
            label: Name
            widget: string
          - name: button
            label: Button Image
            widget: image
            media_folder: "/assets/buttons"
          - name: href
            label: Link
            widget: string
          - name: alt
            label: Alt-text
            widget: string
          - name: hover
            label: Text on hover
            widget: string
            required: false
