Skip to content

initial vitepress redistributable theme + asset syncing configuration#6

Draft
josbeir wants to merge 3 commits intomainfrom
node-package
Draft

initial vitepress redistributable theme + asset syncing configuration#6
josbeir wants to merge 3 commits intomainfrom
node-package

Conversation

@josbeir
Copy link
Collaborator

@josbeir josbeir commented Mar 15, 2026

This refactors the skeleton so it can be used as npm package greatly simplifying its distribution.

Using in a docs project

1. Install

npm install @cakephp/docs-skeleton vitepress

2. Scaffold boilerplate

npx cakedocs init

This creates two files:

File Purpose
.vitepress/config.js Extends the skeleton's base config
.vitepress/theme/index.js Re-exports the CakePHP theme

3. Configure

Edit .vitepress/config.js — your overrides are merged with the base config via VitePress extends:

import baseConfig from '@cakephp/docs-skeleton/config'

export default {
  extends: baseConfig,
  base: '/5.x/',
  themeConfig: {
    sidebar: [],
    nav: [],
    socialLinks: [
      { icon: 'github', link: 'https://github.com/cakephp/cakephp' },
    ],
  },
  substitutions: {
    '|phpversion|': { value: '8.4', format: 'bold' },
    '|minphpversion|': { value: '8.1', format: 'italic' },
  },
}

4. Add scripts to package.json

{
  "scripts": {
    "docs:dev":     "vitepress dev",
    "docs:build":   "vitepress build",
    "docs:preview": "vitepress preview"
  }
}

5. Run

npm run docs:dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant