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-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/1234Run the following command to preview the current branch locally.
./build.sh devOptional: Preview images.
During the build process, the
website-docs/public
directory is generated. To preview images, you can copy the image folder to thewebsite-docs/public
directory during build.To preview images in a TiDB or TiDB Operator document, copy images from
markdown-pages/.../.../master/media
towebsite-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/publicTo preview images in a TiDB Cloud document, copy images from
markdown-pages/en/tidb-cloud/master/media
towebsite-docs/public/media/tidb-cloud
:cp -r markdown-pages/en/tidb-cloud/master/media/. website-docs/public/media/tidb-cloud/Open the preview URL in your browser. For example, http://localhost:8000.
Note that if port
8000
is not available, you need to typey
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/