---
#SETTING UP REUSABLE ALIASES
aliases:
  - &TITLE
    label: 'Title'
    name: 'title'
    widget: 'string'
    hint: 'Enter the title here'
  - &TOP_TEXT
    type: text
    name: topText
    label: top Text
    hint: 'Enter the top text here'
    required: false
  - &BOTTOM_TEXT
    type: text
    name: bottomText
    label: bottom Text
    hint: 'Enter the bottom text here'
    required: false
  - &SUBTITLE
    label: Subtitle
    name: subtitle
    widget: string
    required: false
    hint: 'Enter the subtitle here (optional)'
  - &SUMMARY
    label: Summary
    name: summary
    widget: string
    required: false
    hint: 'Enter the summary here (optional)'
  - &DATE
    label: Date
    name: date
    widget: datetime
    format: YYYY-MM-DD
    timeFormat: false
    hint: 'Enter publish date/time'

  - &POST_TAGS
    label: Post Tags
    name: tags
    widget: list  
    allow_add: true
    field: { name: tags, widget: string }
    required: false
    collapsed: false
    hint: Add tags to categorize the post

  - &MIGRATED
    label: Migration Disclaimer
    name: migrated
    widget: boolean
    default: false
    required: false
    hint: Is this post migrated from the previous iteration of the site?

  - &POST_CATEGORY_TAGS
    label: Post Categories
    name: categories
    widget: select
    multiple: true
    create: true
    options: ["Reviews", "Movies", "Gaming", "Television", "Streaming", "TV", "So Bad It’s Good", "News", "featured", "Entertainment", "Anime", "Trailers"]
    hint: Please contact hi@manikumar.in to add more categories to this pre-saved list.

  - &IMAGE
    label: Image
    name: image
    widget: image
    required: false
    choose_url: false
    hint: Enter your featured image. Assumes you've already cropped and shrunk the image size before upload.

  - &IMAGE_MULTIPLE
    name: image
    label: images
    widget: list
    allow_add: true
    field: *IMAGE
    collapsed: false
    hint: Upload multiple images for the post

  - &LINK_PATTERN ['(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+','Needs to be a valid link.']
  - &BODY
    label: Body
    name: body
    widget: markdown
    required: false
    hint: Enter the body content here

  - &DRAFT
    label: Draft
    name: draft
    widget: boolean
    default: false
    required: false
    hint: Mark this post as a draft if it is not ready for publishing

  - &IS_INDEX
    label: "is_index"
    name: "is_index"
    widget: hidden
    default: false

  - &SEO_TITLE
    label: SEO Title
    name: seotitle
    widget: string
    required: false
    hint: Enter the SEO title for the post

  - &SEO_DESCRIPTION
    label: SEO Description
    name: seodescription
    widget: string
    required: false
    hint: Enter the SEO description for the post

  - &SLUG
    widget: string
    name: slug
    label: Slug
    required: false
    pattern:
      - "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"
      - "A slug can only be lowercase, with hyphens, no spaces, or special characters. It cannot begin or end with a hyphen."
    hint: Enter your custom post link here. Leave blank for default values. Cannot override parent page slug.

  - &PRIVATE
    label: private
    name: private
    widget: boolean
    default: false
    required: false
    hint: Should this post be hidden from the sitemap?

  - &CANONICAL
    label: Canonical Link
    name: canonical
    required: false
    widget: string
    pattern: *LINK_PATTERN
    hint: Enter the exact canonical link. Leave blank if not valid.
  - &VIEW_GROUPS
    view_groups:
    - label: Year
      field: date
      pattern: \d{4}
    - label: Drafts
      field: draft  
  - &FILTER_SETTINGS
    filter: { field: "is_index", value: false }
  - &NO_INDEX
    fields:
      - <<: *TITLE
      - <<: *SEO_TITLE
      - <<: *SEO_DESCRIPTION
      - <<: *CANONICAL
      - <<: *DATE
      - <<: *IMAGE
      - <<: *TOP_TEXT
      - <<: *BOTTOM_TEXT
      - <<: *PRIVATE
      - <<: *DRAFT
      - label: Body
        name: body
        widget: markdown
        required: false
        hint: Actual body text.
        default: <!-- BODY TEXT -->
      - <<: *IS_INDEX
  - &NO_EDIT_INDEX
    fields:
      - <<: *SEO_TITLE
      - <<: *SEO_DESCRIPTION
      - <<: *IMAGE 
  - &BLOG_FIELDS
    fields:
    - << : *TITLE
    - << : *SUMMARY
    - << : *DATE
    - << : *SEO_TITLE
    - << : *SEO_DESCRIPTION
    - << : *IMAGE
    - << : *POST_TAGS
    - << : *POST_CATEGORY_TAGS
    - << : *IS_INDEX
    - label: Authors
      name: author
      widget: select
      multiple: true
      create: true
      options: ["dhun-kumar", "madhav-kapoor", "rahul-majumdar", "rohit-rajput", "sam"]
      hint: Please contact hi@manikumar.in to add more authors to this pre-saved list, or manually enter their profile slug/id here.
    - << : *SLUG
    - << : *BODY
    - << : *DRAFT
    - << : *PRIVATE
    - << : *MIGRATED
    - << : *CANONICAL
      
backend:
  name: gitlab
  repo: darthrahul/the-screen-zone
  branch: main  # Branch to update (optional; defaults to master)
  # commit_messages:
  #   create: "Create {{collection}} “{{slug}}”"
  #   update: "Update {{collection}} “{{slug}}”"
  #   delete: "Delete {{collection}} “{{slug}}”"
  #   uploadMedia: "[skip ci] Upload “{{path}}”"
  #   deleteMedia: "[skip ci] Delete “{{path}}”"
publish_mode: editorial_workflow  

local_backend: true
# These lines should *not* be indented
media_folder: "static/images" # Media files will be stored in the repo under assets/images/uploads
public_folder: "/images/" # The src attribute for uploaded media will begin with /images/uploads
show_preview_links: false
editor:
    preview: false

collections:

  - name: "blog"
    label: "Blog"
    folder: "content/blog"
    sortable_fields: [title','date']
    << : *VIEW_GROUPS
    create: true
    << : *FILTER_SETTINGS
    << : *BLOG_FIELDS

  - name: "blog-archive"
    label: "Blog (Migrated From WP)"
    folder: "content/blog-archive"
    sortable_fields: [title','date']
    media_folder: "/static/images_v1" # Media files will be stored in the repo under assets/images/uploads
    public_folder: "/images_v1/" # The src attribute for uploaded media will begin with /images/uploads
    << : *VIEW_GROUPS
    create: true
    << : *FILTER_SETTINGS
    << : *BLOG_FIELDS

  - name: "authors"
    label: "Authors"
    folder: "content/authors"
    sortable_fields: [title','date']
    << : *VIEW_GROUPS
    create: true
    << : *FILTER_SETTINGS
    fields:
      - << : *TITLE
      - { label: "Designation", name: "designation", widget: "string" }
      - << : *SEO_TITLE
      # - name: id
      #   label: Author ID
      #   hint: "Enter Unique Identifier For Author (eg: rahul-majumdar OR dhun-kumar)"
      #   widget: string
      #   pattern: ["^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$",'Needs to be a valid id']
        # required: true
      - << : *SEO_DESCRIPTION
      - << : *IS_INDEX
      - << : *SLUG
      - << : *IMAGE
      - { label: "is Founder", name: "founder", widget: "boolean", hint: Have they founded this site, required: false }
      - { label: "LinkedIn", name: "linkedin", widget: "string" , required: false}
      - { label: "Website", name: "website", widget: "string" ,  required: false}
      - { label: "Twitter", name: "twitter", widget: "string" , required: false}
      - { label: "Email", name: "email", widget: "string" , required: false}
      - { label: "Instagram", name: "instagram", widget: "string" , required: false}
      - << : *BODY
      - << : *DRAFT
      - << : *PRIVATE
      - << : *CANONICAL

  - name: "podcast"
    label: "Podcast"
    folder: "content/podcast"
    sortable_fields: [title','date']
    << : *VIEW_GROUPS
    create: true
    << : *FILTER_SETTINGS
    fields:
      - << : *TITLE
      - << : *SUMMARY
      - << : *DATE
      - << : *SEO_TITLE
      - << : *SEO_DESCRIPTION
      - << : *IMAGE
      - name: youtube
        label: YouTube ID
        hint: "Enter YouTube ID. NOT YouTube link."
        widget: string
        pattern: ["^[-_a-zA-Z0-9]{11}$",'Needs to be a valid youtube id.']
        required: false
      - name: substackUrl
        label: Substack URL
        hint: "Paste the full Substack episode link (e.g., https://dayzeromedia.substack.com/...)"
        widget: string
        required: false  
      - << : *IS_INDEX
      - << : *SLUG
      - << : *BODY
      - << : *DRAFT
      - << : *PRIVATE
      - << : *MIGRATED
      - << : *CANONICAL

  - name: "disclaimer"
    label: "Disclaimer"
    folder: "content/disclaimer"
    sortable_fields: [title','date']
    << : *VIEW_GROUPS
    create: true
    << : *FILTER_SETTINGS
    fields:
      - << : *TITLE
      - << : *SUMMARY
      - << : *DATE
      - << : *SEO_TITLE
      - << : *SEO_DESCRIPTION
      - << : *TOP_TEXT
      - << : *BOTTOM_TEXT
      - << : *IMAGE
      - << : *POST_TAGS
      - << : *POST_CATEGORY_TAGS
      - << : *IS_INDEX
      - << : *SLUG
      - << : *BODY
      - << : *DRAFT
      - << : *PRIVATE
      - << : *CANONICAL

  - label: "Other Sections"
    name: "other-sections"
    files: 
      - name: "contact"
        label: "Contact"
        file: "content/contact/_index.md"
        fields:
          - << : *TITLE
          - << : *SUMMARY
          - << : *DATE
          - << : *SEO_TITLE
          - << : *SEO_DESCRIPTION
          - << : *TOP_TEXT
          - << : *BOTTOM_TEXT
          - {label: "Contact Email", name: "contactEmail", widget: "string", required: false}
          - {label: "Contact Address", name: "contactAddress", widget: "string", required: false}
          - {label: "Contact Phone", name: "contactPhone", widget: "string", required: false}
          - << : *BODY
      - label: "Info Page (OVERALL EDIT)"
        name: "info"
        file: "content/info/_index.md"
        fields:
        - { label: aboutText, name: aboutText, widget: string , required: false}
        - { label: Facebook URL, name: socialFacebook, widget: string , required: false}
        - { label: Instagram URL, name: socialInstagram, widget: string , required: false}
        - { label: LinkedIn URL, name: socialLinkedin, widget: string , required: false}
        - { label: Twitter URL, name: socialTwitter, widget: string , required: false}
        - { label: Private, name: private, widget: boolean , required: false}
        - { label: Logo, name: logo, widget: image , choose_url: false, hint: Enter your featured image. Assumes you've already cropped and shrunk the image size before upload. , required: false}
  - label: "Scripts 📃"
    name: "scripts"
    files:
      - label: "Header"
        name: "header"
        file: "content/scripts/header.md"
        fields:
        - { label: title, name: title, widget: string , required: false, hidden: true}
        - { label: is_index, name: is_index, widget: bool , required: false, hidden: true}
        - { label: draft, name: draft, widget: bool , required: false, hidden: true}
        - label: Body
          name: body
          widget: markdown
          required: false
          hint: Actual body text.
          default: <!-- BODY TEXT -->
      - label: "Footer"
        name: "footer"
        file: "content/scripts/footer.md"
        fields:
        - { label: title, name: title, widget: string , required: false, hidden: true}
        - { label: is_index, name: is_index, widget: bool , required: false, hidden: true}
        - { label: draft, name: draft, widget: bool , required: false, hidden: true}
        - label: Body
          name: body
          widget: markdown
          required: false
          hint: Actual body text.
          default: <!-- BODY TEXT -->
  - label: "Parent Pages 📃"
    name: "parent-pages"
    files:
      - label: "Blog Parent Page"
        name: "blog"
        file: "content/blog/_index.md"
        <<: *NO_INDEX
      - label: "Podcast Parent Page"
        name: "podcast"
        file: "content/podcast/_index.md"
        <<: *NO_INDEX
      - label: "Author Parent Page"
        name: "authors"
        file: "content/authors/_index.md"
        <<: *NO_INDEX
      - label: "Disclaimer Parent Page"
        name: "disclaimer"
        file: "content/disclaimer/_index.md"
        <<: *NO_INDEX
      - label: "About (ONLY EDIT SEO DATA)"
        name: "about"
        file: "content/about/_index.md"
        <<: *NO_EDIT_INDEX
      - label: "Homepage (ONLY EDIT SEO DATA)"
        name: "homepage"
        file: "content/_index.md"
        <<: *NO_EDIT_INDEX
  - name: "portfolio_data"
    label: "Portfolio Management"
    files:
      - label: "Edit Portfolio Blocks"
        name: "portfolio"
        file: "data/portfolio.yml"
        fields:
          - label: "Profile Intro"
            name: "profile"
            widget: "object"
            fields:
              - {label: "Name", name: "name", widget: "string"}
              - {label: "Bio", name: "bio", widget: "text"}
              - {label: "Contact Info", name: "contact", widget: "string"}
          - label: "Portfolio Sections"
            name: "sections"
            widget: "list"
            fields:
              - {label: "Section Title", name: "title", widget: "string"}
              - {label: "Header Image", name: "header_image", widget: "image", required: false}
              - label: "Bento Boxes (Items)"
                name: "items"
                widget: "list"
                fields:
                  - {label: "Title", name: "title", widget: "string"}
                  - {label: "URL", name: "url", widget: "string"}
                  - {label: "Box Size", name: "size", widget: "select", options: ["small", "medium", "large", "tall"], default: "medium"}
                  - {label: "Box Type", name: "type", widget: "select", options: ["solid", "image"], default: "solid"}
                  - {label: "Background Image", name: "image", widget: "image", required: false}      