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.
Clone the fork
pingcap-docsite-previewto 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/1234Run the following command to preview the current branch locally.
./build.sh devOptional: Preview images.
During the build process, the
website-docs/publicdirectory is generated. To preview images in development mode, copy the image folders towebsite-docs/public/media/{lang}/{product}/. For example:mkdir -p website-docs/public/media/en/tidb cp -r markdown-pages/en/tidb/master/media/. website-docs/public/media/en/tidb/ mkdir -p website-docs/public/media/zh/tidb cp -r markdown-pages/zh/tidb/master/media/. website-docs/public/media/zh/tidb/ mkdir -p website-docs/public/media/en/tidb-in-kubernetes cp -r markdown-pages/en/tidb-in-kubernetes/master/media/. website-docs/public/media/en/tidb-in-kubernetes/ mkdir -p website-docs/public/media/zh/tidb-in-kubernetes cp -r markdown-pages/zh/tidb-in-kubernetes/master/media/. website-docs/public/media/zh/tidb-in-kubernetes/ mkdir -p website-docs/public/media/en/tidb-cloud cp -r markdown-pages/en/tidb-cloud/master/media/. website-docs/public/media/en/tidb-cloud/Open the preview URL in your browser. For example, http://localhost:8000.
Note that if port
8000is not available, you need to typeyin 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/