Skip to content

Pages Configuration

The .dcs/pages.yaml file defines which pages are manageable through the DCS portal.

Overview

yaml
# .dcs/pages.yaml
version: 1
pages:
  - slug: home
    path: /
    type: static
    title: Home
    deletable: false
    textKeys:
      - home.hero.title
      - home.hero.subtitle

Schema

Root Properties

PropertyTypeRequiredDescription
versionnumberYesSchema version (currently 1)
pagesarrayYesList of page definitions

Page Properties

PropertyTypeRequiredDescription
slugstringYesUnique URL-safe identifier
pathstringYesURL path for the page
typestringYesstatic, index, or dynamic
titlestringYesHuman-readable page title
deletablebooleanNoWhether page can be deleted (default: true)
textKeysarrayNoText keys used on this page
templatestringNoTemplate to use for new pages
dynamicParamstringNoDynamic parameter name for dynamic pages

Page Types

Static Pages

Regular pages created by users:

yaml
- slug: about
  path: /about
  type: static
  title: About Us
  deletable: true
  textKeys:
    - about.hero.title
    - about.team.title

Index Pages

Collection landing pages (protected):

yaml
- slug: blogs
  path: /blogs
  type: index
  title: Blog
  deletable: false

Dynamic Pages

Generated pages with URL parameters:

yaml
- slug: blog-post
  path: /blogs/:slug
  type: dynamic
  title: Blog Post
  deletable: false
  dynamicParam: slug

Examples

Minimal Configuration

yaml
version: 1
pages:
  - slug: home
    path: /
    type: static
    title: Home
    deletable: false

Standard Site

yaml
version: 1
pages:
  # Home page (protected)
  - slug: home
    path: /
    type: static
    title: Home
    deletable: false
    textKeys:
      - home.hero.title
      - home.hero.subtitle
      - home.features.title
      
  # About page
  - slug: about
    path: /about
    type: static
    title: About
    deletable: true
    textKeys:
      - about.hero.title
      - about.mission.title
      - about.mission.description
      
  # Services page
  - slug: services
    path: /services
    type: static
    title: Services
    deletable: true
    
  # Contact page
  - slug: contact
    path: /contact
    type: static
    title: Contact
    deletable: true
    textKeys:
      - contact.form.title
      
  # Blog index (protected)
  - slug: blogs
    path: /blogs
    type: index
    title: Blog
    deletable: false
    
  # Individual blog posts
  - slug: blog-post
    path: /blogs/:slug
    type: dynamic
    title: Blog Post
    deletable: false
    dynamicParam: slug

E-commerce Site

yaml
version: 1
pages:
  - slug: home
    path: /
    type: static
    title: Home
    deletable: false
    
  - slug: products
    path: /products
    type: index
    title: Products
    deletable: false
    
  - slug: product
    path: /products/:id
    type: dynamic
    title: Product Detail
    dynamicParam: id
    
  - slug: categories
    path: /categories
    type: index
    title: Categories
    deletable: false
    
  - slug: category
    path: /categories/:slug
    type: dynamic
    title: Category
    dynamicParam: slug
    
  - slug: cart
    path: /cart
    type: static
    title: Cart
    deletable: false
    
  - slug: checkout
    path: /checkout
    type: static
    title: Checkout
    deletable: false

Text Keys

Key Naming Convention

{page}.{section}.{element}

Examples:

  • home.hero.title
  • about.team.description
  • contact.form.submit

Nested Keys

For repeated elements:

{page}.{section}.{index}.{element}

Examples:

  • home.features.0.title
  • home.features.1.title
  • home.testimonials.0.quote

Auto-Discovery

DCS can auto-discover text keys during snapshot:

yaml
- slug: home
  path: /
  type: static
  title: Home
  textKeys: []  # Auto-populated during snapshot

Protected Pages

Certain slugs should always be protected:

yaml
# These should have deletable: false
- slug: home
  deletable: false

- slug: blogs
  deletable: false

- slug: 404
  deletable: false

Creating Pages via Portal

When users create pages through the portal:

  1. New entry added to pages.yaml
  2. Page file created from template
  3. Development request auto-created
  4. GitHub Copilot implements content

Template Reference

yaml
- slug: services
  path: /services
  type: static
  title: Services
  deletable: true
  template: standard  # Uses standard page template

Available templates:

  • standard — Basic page with hero
  • landing — Marketing landing page
  • content — Long-form content page

Validation

Required Fields

All pages must have:

  • slug — Unique, URL-safe
  • path — Valid URL path
  • type — One of: static, index, dynamic
  • title — Non-empty string

Slug Rules

  • Lowercase only
  • Hyphens for word separation
  • No special characters
  • Unique across all pages

Path Rules

  • Must start with /
  • Dynamic segments use :param syntax
  • Must be unique for static pages

CLI Commands

Validate pages.yaml

bash
dcs pages validate

List all pages

bash
dcs pages list

Add a page

bash
dcs pages add --slug about --path /about --title "About Us"

Troubleshooting

Page Not Appearing in Portal

  1. Verify pages.yaml syntax
  2. Check slug uniqueness
  3. Ensure path is valid
  4. Run validation: dcs pages validate

Text Keys Not Working

  1. Verify key format: page.section.element
  2. Check for typos in component usage
  3. Ensure text override exists in portal

Dynamic Page Issues

  1. Verify dynamicParam is set
  2. Check path includes :param segment
  3. Ensure data source provides param values

Next Steps

Duff Cloud Services Documentation