Want Netlify CMS to Edit a HTML File

Hi,
I am using hugo and want to edit some html files within cms.

Here’s the config code, but i doesn’t work by saying “slice is not a function”

  - label: ADS
    name: "Ads on Site"
    files:
      - label: Above Content - Below Header
        name: "above_content"
        file: /layouts/partials/ads/above-content.html
        fields:
          - { label: Code, name: body, widget: code, required: false, default_language: "HTML" }
      - label: Below Products
        name: "below_products"
        file: /layouts/partials/ads/below-product.html
        fields:
          - { label: Code, name: body, widget: code, required: false, default_language: "HTML" }
      - label: Sidebar
        name: "sidebar_ads"
        file: /layouts/partials/ads/sidebar.html
        fields:
          - { label: Code, name: body, widget: code, required: false, default_language: "HTML" }

Netlify CMS doesn’t support editing html files. It can only edit data, such as yml, markdown and json. You can transform that data to pages. Check out this Hugo guide:

1 Like