Used to use Docsify for documentation? no problem! Satisfy you

Docsify is a beautiful tool for dynamically generating documents. If you just need to quickly build a small documentation website, or don't want to "pollute" the commit record because of a bunch of .html files generated, you only need to create an index.html to start writing documents and deploy directly on the cloud development static hosting.

Cloud Development (CloudBase) is a cloud-integrated product solution. It adopts serverless architecture, environment-free construction and other operation and maintenance transactions, supports one cloud and multiple ends, and helps quickly build small programs, Web applications, and mobile applications.

Cloud development static website hosting supports calling server-side resources such as cloud functions, cloud storage, cloud databases, etc. through the cloud development SDK, thereby expanding static websites to full-stack websites.

Whether it is a Tencent cloud · cloud development user or an applet · cloud development user, as long as the subscription is paid according to the volume, you can enjoy the cloud development static website hosting service.

Let's Go

Next, we proceed in three steps: setting up the environment → creating a project → deploying

Build environment

1. Install Node.js and npm

By node -v command to see if the unit is installed, if not installed, refer to node.js installation guide for installation according to the computer system environment

2. Install cloudbase / cli

npm install -g @cloudbase/cli

3. Install docsify-cli

npm i docsify-cli -g

4. Test whether the installation is successful

cloudbase -v

docsify -v

If you see the output version number, the installation has been successful.

Create project

Initialize this project

docsify init docs

After the initialization is complete, you can modify the contents of the /docs/README.md file and then run it locally

image-20200417170813684

Run local server

docsify serve docs

After running successfully, open a browser and visit localhost: 3000

image-20200417170833249

deploy

Create a cloud development environment

Visit the Tencent Cloud Cloud development console , create a new " pay- per-view cloud development environment", remember the cloud development environment ID, we need to use the cloud development website hosting service, currently only the pay-per-view environment supports static hosting.

image-20200417170842325

Enter the website hosting control page to activate the static website hosting service

image-20200417170849134

When you see this interface, it means that it has been opened.

Sign in

tcb login

At this time, you will be reminded that you need to authorize in the web page, confirm the authorization in the pop-up page

image-20200417170921343

After confirming the authorization, you will see the corresponding command output on the console

Execute the command to upload the file, remember to replace the EnvID here with the environment ID of your own environment

tcb hosting:deploy ./ -e EnvID

Wait a moment, the file will be uploaded

image-20200417170931056

View static website domain name and status

tcb hosting:detail -e envId

At this time you will see the static website domain name, just open the browser to access

image-20200417170939503

At this time, you can access the cloud development console to view the uploaded files

image-20200417170949508

Click Settings, you can see the default domain name output by the console, of course, you can also add your own domain name

summary

Deployment environment used in the process ID envId, can cloud development console view, docsify basic usage can go to their official website to see

If you encounter problems during the operation, you can comment and leave your question

One More Thing

Cloud development CloudBase is a new upgrade, supporting small program development, Web and APP multi-end application development! There is also a 9.9 yuan cloud development static website hosting package annual sponsorship plan! What are you waiting for? Come and experience it!

Public number: Tencent Yunyun Development

Tencent Cloud Development: https://cloudbase.net

Cloud development console: https://console.cloud.tencent.com/tcb?from=12304

☁More
exciting
Scan QR code to learn more

Guess you like

Origin www.cnblogs.com/CloudBase/p/12739443.html