PingCAP Docsite Preview Help

Deploy your website locally

This document describes how to deploy your documentation website using your local machine.

Prerequisites

Make sure that you have installed the following tools:

    Steps

    Perform the following steps to deploy a live preview of your documentation website locally.

    1. Clone the fork pingcap-docsite-preview to your local machine and switch to the branch you want to preview.

      git clone https://github.com/Oreoxmt/pingcap-docsite-preview.git cd pingcap-docsite-preview git checkout preview/pingcap/docs/1234
    2. Run the following command to preview the current branch locally.

      ./build.sh dev
    3. Optional: Preview images.

      During the build process, the website-docs/public directory is generated. To preview images, you can copy the image folder to the website-docs/public directory during build.

      To preview images in a TiDB or TiDB Operator document, copy images from markdown-pages/.../.../master/media to website-docs/public:

      cp -r markdown-pages/en/tidb/master/media website-docs/public cp -r markdown-pages/zh/tidb/master/media website-docs/public cp -r markdown-pages/en/tidb-in-kubernetes/master/media website-docs/public cp -r markdown-pages/zh/tidb-in-kubernetes/master/media website-docs/public

      To preview images in a TiDB Cloud document, copy images from markdown-pages/en/tidb-cloud/master/media to website-docs/public/media/tidb-cloud:

      cp -r markdown-pages/en/tidb-cloud/master/media/. website-docs/public/media/tidb-cloud/
    4. Open the preview URL in your browser. For example, http://localhost:8000.

      Note that if port 8000 is not available, you need to type y in your terminal to use another port:

      Something is already running at port 8000 ✔ Would you like to run the app at another port instead? … yes ... You can now view website-docs in the browser. http://localhost:8001/
    Last modified: 01 April 2025