Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
# Basic docker based environment
# Necessary to trick dokku into building the documentation
# using dockerfile instead of herokuish
FROM php:8.1
# ----------------------
# 1. Build stage
# ----------------------
FROM node:22-alpine AS builder

WORKDIR /code
# Git is required because docs/package.json pulls a dependency from GitHub.
RUN apk add --no-cache git openssh-client

VOLUME ["/code"]
WORKDIR /app/docs

CMD [ '/bin/bash' ]
# 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;"]
24 changes: 0 additions & 24 deletions docs.Dockerfile

This file was deleted.

4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
*/public/
.vitepress/cache
.vitepress/dist
76 changes: 76 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
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 toc_fr = require("./toc_fr.json");
const toc_ja = require("./toc_ja.json");
const toc_pt = require("./toc_pt.json");

const versions = {
text: "3.x",
items: [
{ text: "3.x (current)", link: "https://book.cakephp.org/chronos/3/en/", target: '_self' },
{ text: "2.x", link: "https://book.cakephp.org/chronos/2/en/", target: '_self' },
],
};

// This file contains overrides for .vitepress/config.js
export default {
extends: baseConfig,
srcDir: '.',
title: 'Chronos',
description: 'CakePHP Chronos Documentation',
base: "/3/",
rewrites: {
"en/:slug*": ":slug*",
},
sitemap: {
hostname: "https://book.cakephp.org/chronos/3/",
},
themeConfig: {
socialLinks: [
{ icon: "github", link: "https://github.com/cakephp/chronos" },
],
editLink: {
pattern: "https://github.com/cakephp/chronos/edit/3.x/docs/:path",
text: "Edit this page on GitHub",
},
sidebar: toc_en,
nav: [
{ text: "CakePHP", link: "https://cakephp.org" },
{ text: "API", link: "https://api.cakephp.org/chronos" },
{ ...versions },
],
},
locales: {
root: {
label: "English",
lang: "en",
themeConfig: {
sidebar: toc_en,
},
},
'/fr/': {
label: "Français",
lang: "fr",
themeConfig: {
sidebar: toc_fr,
},
},
'/ja/': {
label: "日本語",
lang: "ja",
themeConfig: {
sidebar: toc_ja,
},
},
'/pt/': {
label: "Português",
lang: "pt",
themeConfig: {
sidebar: toc_pt,
},
},
},
};
1 change: 1 addition & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '@cakephp/docs-skeleton'
13 changes: 13 additions & 0 deletions docs/.vitepress/toc_en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"/": [
{
"text": "CakePHP Chronos",
"collapsed": false,
"items": [
{ "text": "Introduction", "link": "/index" },
{ "text": "3.x Migration Guide", "link": "/3-x-migration-guide" },
{ "text": "API", "link": "https://api.cakephp.org/chronos" }
]
}
]
}
12 changes: 12 additions & 0 deletions docs/.vitepress/toc_fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"/fr/": [
{
"text": "CakePHP Chronos",
"collapsed": false,
"items": [
{ "text": "Introduction", "link": "/fr/index" },
{ "text": "API", "link": "https://api.cakephp.org/chronos" }
]
}
]
}
12 changes: 12 additions & 0 deletions docs/.vitepress/toc_ja.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"/ja/": [
{
"text": "CakePHP Chronos",
"collapsed": false,
"items": [
{ "text": "概要", "link": "/ja/index" },
{ "text": "API", "link": "https://api.cakephp.org/chronos" }
]
}
]
}
12 changes: 12 additions & 0 deletions docs/.vitepress/toc_pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"/pt/": [
{
"text": "CakePHP Chronos",
"collapsed": false,
"items": [
{ "text": "Introdução", "link": "/pt/index" },
{ "text": "API", "link": "https://api.cakephp.org/chronos" }
]
}
]
}
Empty file removed docs/config/__init__.py
Empty file.
50 changes: 0 additions & 50 deletions docs/config/all.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
3.x Migration Guide
###################
# 3.x Migration Guide

Chronos 3.x contains breaking changes that could impact your application. This
guide provides an overview of the breaking changes made in 3.x

Minimum of PHP 8.1
==================
## Minimum of PHP 8.1

Chronos 3.x requires at least PHP 8.1. This allows chronos to provide more
comprehensive typehinting and better performance by leveraging features found in
newer PHP versions.

MutableDateTime and MutableDate removed
=======================================
## MutableDateTime and MutableDate removed

The ``MutableDateTime`` and ``MutableDate`` classes have been removed. Long term
The `MutableDateTime` and `MutableDate` classes have been removed. Long term
PHP will be deprecating and removing mutable datetime classes in favour of
immutable ones. Chronos has long favoured immutable objects and removing the
mutable variants helps simplify the internals of Chronos and encourages safer
Expand Down
9 changes: 0 additions & 9 deletions docs/en/conf.py

This file was deleted.

7 changes: 0 additions & 7 deletions docs/en/contents.rst

This file was deleted.

Loading
Loading