-
Notifications
You must be signed in to change notification settings - Fork 121
Introduce VitePress documentation using @cakephp/docs-skeleton #1055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
josbeir
wants to merge
6
commits into
5.x
Choose a base branch
from
5.x-newdocs
base: 5.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5bc3fa6
initial vitepress conversion
josbeir 7f099af
clean up version switcher
josbeir 6178d64
add Dockerfile for docs build step
LordSimal 24e53a2
docs: Add anonymous migration classes documentation (#1056)
dereuromark 29c2fb2
Fix prev verion urls
josbeir 3b17f25
Don't run CI on doc changes
josbeir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,36 @@ | ||
| # Basic docker based environment | ||
| # Necessary to trick dokku into building the documentation | ||
| # using dockerfile instead of herokuish | ||
| FROM ubuntu:22.04 | ||
|
|
||
| # Add basic tools | ||
| RUN apt-get update && \ | ||
| apt-get install -y build-essential \ | ||
| software-properties-common \ | ||
| curl \ | ||
| git \ | ||
| libxml2 \ | ||
| libffi-dev \ | ||
| libssl-dev && \ | ||
| LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ | ||
| apt-get update && \ | ||
| apt-get install -y php8.1-cli php8.1-mbstring php8.1-xml php8.1-zip php8.1-intl php8.1-opcache php8.1-sqlite &&\ | ||
| apt-get clean &&\ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /code | ||
|
|
||
| VOLUME ["/code"] | ||
|
|
||
| CMD [ '/bin/bash' ] | ||
| # ---------------------- | ||
| # 1. Build stage | ||
| # ---------------------- | ||
| FROM node:22-alpine AS builder | ||
|
|
||
| # Git is required because docs/package.json pulls a dependency from GitHub. | ||
| RUN apk add --no-cache git openssh-client | ||
|
|
||
| WORKDIR /app/docs | ||
|
|
||
| # Copy dependency manifests first to preserve Docker layer caching. | ||
| COPY docs/ ./ | ||
| RUN npm ci | ||
|
|
||
| # Increase max-old-space-size to avoid memory issues during build | ||
| ENV NODE_OPTIONS="--max-old-space-size=8192" | ||
|
|
||
| # Build the site. | ||
| RUN npm run docs:build | ||
|
|
||
| # ---------------------- | ||
| # 2. Runtime stage (nginx) | ||
| # ---------------------- | ||
| FROM nginx:1.27-alpine AS runner | ||
|
|
||
| # Copy built files | ||
| COPY --from=builder /app/docs/.vitepress/dist /usr/share/nginx/html | ||
|
|
||
| # Expose port | ||
| EXPOSE 80 | ||
|
|
||
| # Health check (optional) | ||
| HEALTHCHECK CMD wget --quiet --tries=1 --spider http://localhost:80/ || exit 1 | ||
|
|
||
| # Start nginx | ||
| CMD ["nginx", "-g", "daemon off;"] |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| node_modules | ||
| */public/ | ||
| .vitepress/cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import baseConfig from '@cakephp/docs-skeleton/config' | ||
|
|
||
| import { createRequire } from "module"; | ||
| const require = createRequire(import.meta.url); | ||
| const toc_en = require("./toc_en.json"); | ||
|
|
||
| const versions = { | ||
| text: "5.x", | ||
| items: [ | ||
| { text: "5.x (current)", link: "book.cakephp.org/migrations/5.x/", target: '_self' }, | ||
| { text: "4.x", link: "https://book.cakephp.org/migrations/4/", target: '_self' }, | ||
| { text: "3.x", link: "https://book.cakephp.org/migrations/3/", target: '_self' }, | ||
| { text: "2.x", link: "https://book.cakephp.org/migrations/2/", target: '_self' }, | ||
| ], | ||
| }; | ||
|
|
||
| // This file contains overrides for .vitepress/config.js | ||
| export default { | ||
| extends: baseConfig, | ||
| srcDir: 'en', | ||
| title: 'Migrations plugin', | ||
| description: 'Migrations - CakePHP migrations Documentation', | ||
| base: "/5.x/", | ||
| rewrites: { | ||
| "en/:slug*": ":slug*", | ||
| }, | ||
| sitemap: { | ||
| hostname: "https://book.cakephp.org/migrations/5.x/", | ||
| }, | ||
| themeConfig: { | ||
| socialLinks: [ | ||
| { icon: "github", link: "https://github.com/cakephp/cakephp" }, | ||
| ], | ||
| editLink: { | ||
| pattern: "https://github.com/cakephp/migrations/edit/5.x/docs/:path", | ||
| text: "Edit this page on GitHub", | ||
| }, | ||
| sidebar: toc_en, | ||
| nav: [ | ||
| { text: "CakePHP Book", link: "https://book.cakephp.org/" }, | ||
| { ...versions }, | ||
| ], | ||
| }, | ||
| substitutions: {}, | ||
| locales: { | ||
| root: { | ||
| label: "English", | ||
| lang: "en", | ||
| }, | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { default } from '@cakephp/docs-skeleton' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "/": [ | ||
| { | ||
| "text": "Migrations", | ||
| "collapsed": false, | ||
| "items": [ | ||
| { "text": "Introduction", "link": "/index" }, | ||
| { "text": "Writing Migrations", "link": "/writing-migrations" }, | ||
| { "text": "Using the Query Builder", "link": "/using-the-query-builder" }, | ||
| { "text": "Executing Queries", "link": "/executing-queries" }, | ||
| { "text": "Database Seeding", "link": "/seeding" } | ||
| ] | ||
| }, | ||
| { | ||
| "text": "Upgrade Guides", | ||
| "collapsed": true, | ||
| "items": [ | ||
| { "text": "Upgrading from 4.x to 5.x", "link": "/upgrading" }, | ||
| { "text": "Upgrading to the Builtin Backend", "link": "/upgrading-to-builtin-backend" } | ||
| ] | ||
| } | ||
| ] | ||
| } |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ### CakePHP Migrations | ||
|
|
||
| - [Migrations 5.x](index) | ||
| - [Writing Migrations](writing-migrations) | ||
josbeir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - [Using the Query Builder](using-the-query-builder) | ||
| - [Executing Queries](executing-queries) | ||
| - [Database Seeding](seeding) | ||
josbeir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - [Upgrading to the builtin backend](upgrading-to-builtin-backend) | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.