Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to quickly create a personal blog system with Docsify + Serverless Framework

Shulou Source: shulou.com Published: 2022-05-31 18:53:09 09月21日 Update

This article introduces you Docsify + Serverless Framework how to quickly create a personal blog system, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Create a blog system with docsify, then deploy the service with Serverless Framework, and it will be done in three minutes!

A brief introduction:

Docsify: a magical document website generation tool, unlike GitBook, Hexo, it does not generate .md to .html files, all the conversion work is done at run time. And if you just need to quickly build a small documentation site, or do not want to generate a pile of .html files to "pollute" commit records, just create an index.html to start writing documents

Serverless Framework: with 30, 000 stars on GitHub, it is a very popular serverless application framework in the industry. Developers can deploy a fully available Serverless application architecture without paying attention to the underlying resources.

Next we will do this in three steps: install and initialize the → configuration yml file → deployment

▎ installation and initialization

First, make sure that the system contains the following environments:

Node.js (Node.js version should be no less than 8.6, version 10.0 or above is recommended)

Git

1. Install Serverless Framework

$npm install-g serverless

two。 Install docsify

$npm I docsify-cli-g

3. Initialize the project

$docsify init docsify

After successful initialization, you can see several files created in the. / docsify directory

Index.html entry file

README.md will render as the home page content.

You can update the content of the site by editing docsify/README.md directly, and of course you can write multiple pages, which is later.

4. Local preview

Run the following command and visit http://localhost:3000 through the browser to easily preview the effect, and provide LiveReload function, you can preview in real time.

$docsify serve docsify ▎ configuration yml file

Under the project directory, create the serverless.yml file:

$touch serverless.yml

Write the following to the yml file above:

# serverless.ymlmydocsify: component: "@ serverless/tencent-website" inputs: code: src:. / docsify # Upload static files generated by docsify index: index.html error: index.html region: ap-guangzhou bucketName: my-bucket

After the configuration is complete, the file directory is as follows:

.├── docsify | ├── index.html | └── README.md └── serverless.yml ▎ deployment

Deploy through the sls command, and you can also add the-- debug parameter to view the information during the deployment process.

$sls-debug

If your account is not logged in or registered with Tencent Cloud, you can log in and register by scanning the QR code on the command line directly through Wechat. This is also a place that I think is very convenient!

During deployment, the terminal displays information to indicate:

Visit the url output from the command line to view the docsify documentation website deployed using Serverless Framework ~

About Docsify + Serverless Framework how to quickly create a personal blog system to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Files content systems commands documents websites blogs directories builds configurations personal information places more versions processes projects help applications services Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS vpn Shulou Tech Info OPPO Reno Docker