# Reference
# https://github.com/netlify/netlify-cms/issues/3928
# https://github.com/robinpokorny/netlify-cms-now

backend:
  name: git-gateway
  repo: hydrosquall/dvny-site
  branch: main
  base_url: https://datavizny.com/

public_folder: /public
media_folder: /public/uploads
publish_mode: editorial_workflow

collections:
  - name: "meetup_events"
    label: "Meetups"
    label_singular: "Meetup"
    folder: /static_data/events
    create: true
    slug: "{{year}}-{{month}}-{{day}}"
    sortable_fields:
      - time
      - name
      - created
    view_groups:
      - label: Year
        field: local_date
        # groups items based on the value matched by the pattern
        pattern: \d{4}

    # https://www.netlifycms.org/docs/widgets/
    fields:
      - { label: "Name", name: "name", widget: "string" }
      - { label: "Comment Count", name: "comment_count", widget: "number", required: false }
      - { label: "RSVP limit", name: "rsvp_limit", widget: "number", required: false }
      - { label: "Yes RSVP Count", name: "yes_rsvp_count", widget: "number", required: false }
      - {label: "Body", name: "body", widget: "markdown"}

      - label: Featured Photo
        name: featured_photo
        widget: object
        collapsed: true
        fields:
          - { label: "High res", name: "highres_link", widget: "string", required: false }
          - { label: "Photo", name: "photo_link", widget: "string", required: false }
          - { label: "Thumb", name: "thumb_link", widget: "string", required: false }
        required: false

      # Datetime Formats: https://momentjs.com/docs/#/parsing/string-format/
      - { label: "Created", name: "created", widget: "datetime", format: 'x' } # unix milliseconds
      - { label: "Time", name: "time", widget: "datetime", format: 'x' }
      - { label: "Meetup ID", name: "id", widget: "string" }
      - { label: "Meetup Link", name: "link", widget: "string" }

      - { label: "Is Online Event", name: "is_online_event", widget: "boolean", required: false }
      - { label: "Member pay fee", name: "member_pay_fee", widget: "boolean", required: false }
      - { label: "Local date", name: "local_date", widget: "datetime", format: 'YYYY-MM-DD', required: false } # technically dupe

      - { label: "Short Description", name: "short_description", widget: "text", required: false  }
      - label: "Speakers"
        name: "speakers"
        widget: "list"
        fields:
          - { label: "Name", name: "name", widget: "string" }
          - { label: "ID", name: "id", widget: "string", required: false } # in case we ever want to normalize them

      - label: "Presentation Links (Slides etc)"
        name: "presentation_links"
        widget: "list"
        fields:
          - { label: "Name", name: "name", widget: "string" }
          - { label: "Url", name: "url", widget: "string" }
          - { label: "Description", name: "description", widget: "text", required: false }

      - label: "Recording Links"
        name: "recording_links"
        widget: "list"
        fields:
          - { label: "Name", name: "name", widget: "string" }
          - { label: "Url", name: "url", widget: "string" }
          - { label: "Description", name: "description", widget: "text", required: false }

      - label: "Related Links"
        name: "related_links"
        widget: "list"
        fields:
          - { label: "Name", name: "name", widget: "string" }
          - { label: "Url", name: "url", widget: "string" }
          - { label: "Description", name: "description", widget: "text", required: false }
