.cursor/skills/site-data-navigation/SKILL.md
Configure site-wide data including navigation, footer, and SEO. Use when setting up or editing mainNav.json, footer.json, seo.json, or understanding how navigation components consume data.
npx skillsauth add CloudCannon/astro-component-starter site-data-navigationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Site-wide data (navigation, footer, SEO) lives in JSON files under src/data/. These are imported directly in layouts and components, and are editable through CloudCannon's data collection.
| File | Purpose | Consumed by |
| ----------------------- | ----------------- | -------------------------------- |
| src/data/mainNav.json | Header navigation | MainNav.astro via Page.astro |
| src/data/footer.json | Footer content | Footer.astro via Page.astro |
| src/data/seo.json | SEO defaults | BaseLayout.astro |
src/data/mainNav.json){
"logoSource": "/images/logo.svg",
"logoAlt": "Logo",
"navData": [
{
"name": "Home",
"path": "/",
"children": []
},
{
"name": "Services",
"path": "/services/",
"children": [
{
"name": "Consulting",
"path": "/services/consulting/",
"children": []
},
{
"name": "Development",
"path": "/services/development/",
"children": []
}
]
}
],
"buttonSections": [
{
"_component": "building-blocks/core-elements/button",
"text": "Search",
"hideText": true,
"link": "/search/",
"iconName": "magnifying-glass",
"iconPosition": "before",
"variant": "ghost",
"size": "lg"
}
]
}
| Field | Type | Purpose |
| ---------------- | ------ | ---------------------------------------------------- |
| logoSource | string | Path to logo image (static /images/ or asset path) |
| logoAlt | string | Alt text for logo |
| navData | array | Navigation items (up to 3 levels deep) |
| buttonSections | array | Action buttons in the nav bar (e.g., search, CTA) |
Each item in navData has:
| Field | Type | Purpose |
| ---------- | ------ | -------------------------------------------- |
| name | string | Display text |
| path | string | URL path (use trailing slash) |
| children | array | Child nav items (same shape, up to 3 levels) |
Three nesting levels are supported. CloudCannon provides structure definitions for each level (navItemLevel1, navItemLevel2, navItemLevel3) in the nav component's inputs file.
MainNav.astro receives the full JSON as props via Page.astro. It renders:
Bar component with navDataButtonGroup with buttonSectionsMobile component (merges buttonSections into navData as synthetic items)The nav is sticky-positioned at the top of the page with z-index: var(--layer-2).
src/data/footer.json){
"logoSource": "/images/logo.svg",
"logoAlt": "Logo",
"links": [
{
"name": "Home",
"path": "/"
},
{
"name": "About",
"path": "/about/"
},
{
"name": "Blog",
"path": "/blog/"
}
],
"socials": [
{
"icon": "social/github",
"link": "https://github.com/your-org"
},
{
"icon": "social/x",
"link": "https://twitter.com/your-handle"
},
{
"icon": "social/linkedin",
"link": "https://linkedin.com/company/your-company"
}
],
"footerText": "© 2026 Your Company. All rights reserved."
}
| Field | Type | Purpose |
| ------------ | ------ | ----------------------- |
| logoSource | string | Path to footer logo |
| logoAlt | string | Alt text for logo |
| links | array | Footer navigation links |
| socials | array | Social media icon links |
| footerText | string | Copyright / legal text |
| Field | Type | Purpose |
| ------ | ------ | ------------ |
| name | string | Display text |
| path | string | URL path |
| Field | Type | Purpose |
| ------ | ------ | ---------------------------------------------- |
| icon | string | Icon name from icon set (use social/ prefix) |
| link | string | Full URL to social profile |
Icons live in src/icons/social/. Common options:
social/githubsocial/xsocial/linkedinsocial/facebooksocial/instagramsocial/youtubeCheck src/icons/social/ for the full list of available SVGs.
Footer.astro renders:
Bar component)src/data/seo.json){
"name": "Your Site Name",
"url": "https://yourdomain.com",
"description": "Default meta description for pages without one.",
"logoSource": "/images/logo.svg",
"titleFormat": "{title} | Your Site Name",
"twitterHandle": "@yourhandle"
}
| Field | Type | Purpose |
| --------------- | ------ | --------------------------------------------------------- |
| name | string | Site name (used in structured data) |
| url | string | Production URL (used in structured data, canonical links) |
| description | string | Fallback meta description |
| logoSource | string | Fallback OG image |
| titleFormat | string | Title template — {title} is replaced with page title |
| twitterHandle | string | Twitter/X handle for social cards |
BaseLayout.astro imports seo.json and uses it for:
<title> tag via the title format templateStructuredData.astro — renders JSON-LD Organization schemaPer-page overrides come from page frontmatter (description, image, canonical). The page title is always from frontmatter; SEO data provides the wrapping format.
src/data/mainNav.json ─┐
├→ src/pages/[...slug].astro (imports both)
src/data/footer.json ─┘ │
↓
src/layouts/Page.astro
│ │
↓ ↓
MainNav.astro Footer.astro
src/data/seo.json ──→ src/layouts/BaseLayout.astro
│ │
↓ ↓
<SEO> tags StructuredData.astro
The data collection in cloudcannon.config.yml makes all JSON files editable:
data:
path: src/data
glob:
- '**/*.json'
icon: database
_enabled_editors:
- data
Editors see a "Data" section in CloudCannon with entries for mainNav, footer, and seo.
CloudCannon uses structure files in .cloudcannon/structures/ to define the shape of array items:
| Structure file | Used for |
| ------------------------------------ | --------------------------- |
| navData.cloudcannon.structures.yml | Navigation items (3 levels) |
| links.cloudcannon.structures.yml | Footer links |
| socials.cloudcannon.structures.yml | Social media links |
These are loaded globally via _structures_from_glob in cloudcannon.config.yml.
The nav component also defines its own inline structures in main-nav.cloudcannon.inputs.yml for the same nav item levels — these provide CloudCannon with field types and comments for the editing UI.
Edit src/data/seo.json:
name to the site nameurl to the production URLdescription to the default meta descriptiontitleFormat to include the site nametwitterHandleAlso update site in astro.config.mjs to match the production URL.
Edit src/data/mainNav.json:
logoSource with the site's logo path (place the SVG in public/images/)logoAltnavData with the site's navigation structurebuttonSections (or set to [] to remove nav buttons)Edit src/data/footer.json:
logoSource and logoAltlinks with footer navigationsocials with actual social media linksfooterText with copyright textPlace logo files in public/images/ for static serving, or in src/assets/images/ if you want Astro image optimization. The nav and footer reference these via logoSource.
testing
Customize the design system for brand matching. Use when changing colors, fonts, spacing, or other design tokens, extending the theme system, or migrating an existing brand into this Astro component starter.
development
Build a new page section component from a screenshot. Use when the user pastes a screenshot of a UI section and wants it turned into an Astro component with CloudCannon configuration.
development
Assemble pages from existing components in the Astro + CloudCannon component library. Use when building new pages, populating pageSections YAML, choosing which components to use, or understanding how page content files work.
development
Migrate an existing website into the Astro + CloudCannon component starter. Use when converting an existing site's pages, content, branding, and structure into this component library.