Total Pageviews

Saturday, 26 February 2022

文档网站程序Docusaurus

 Easy to maintain open source documentation website app.

https://docusaurus.io/

We are working hard on Docusaurus v2. If you are new to Docusaurus, try using the new version instead of v1. See the Docusaurus v2 website for more details.

Docusaurus v1 doc is available at v1.docusaurus.io and code is available on branch docusaurus-v1

Introduction

Docusaurus is a project for building, deploying, and maintaining open source project websites easily.

Short on time? Check out our 5-minute tutorial ⏱️!

Tip: use docusaurus.new to test Docusaurus immediately in a playground.

  • Simple to Start

Docusaurus is built in a way so that it can get running in as little time as possible. We've built Docusaurus to handle the website build process so you can focus on your project.

  • Localizable

Docusaurus ships with localization support via CrowdIn. Empower and grow your international community by translating your documentation.

  • Customizable

While Docusaurus ships with the key pages and sections you need to get started, including a home page, a docs section, a blog, and additional support pages, it is also customizable as well to ensure you have a site that is uniquely yours.

Installation

Use the initialization cli to create your site:

npm init docusaurus@latest [name] [template]

Example:

$ npm init docusaurus@latest docusaurus-site classic (会在当前目录下,生成docusaurus-site目录。)
显示:
[SUCCESS] Created docusaurus-site.
[INFO] Inside that directory, you can run several commands:

`npm start`
Starts the development server.

`npm run build` (此即生成/更新静态网站的根目录的命令)
Bundles your website into static files for production.

`npm run serve`
Serves the built website locally.

`npm run deploy`
Publishes the website to GitHub pages.

We recommend that you begin by typing:

`cd docusaurus-site`
`npm start`

Happy building awesome websites!
$ cd docusaurus-site
$ npm run build 
显示:
[SUCCESS] Generated static files in "build".
[INFO] Use `npm run serve` command to test your build locally.
$ cd build
~/docusaurus-site/build$ ls
404.html assets/ blog/ docs/ img/ index.html markdown-page/ sitemap.xml 
(可见~/docusaurus-site/build就是静态网站的根目录)
 ~/docusaurus-site/build$ cd ../blog
~/docusaurus-site/blog$ ls
2019-05-28-first-blog-post.md 2021-08-01-mdx-blog-post.mdx authors.yml
2019-05-29-long-blog-post.md 2021-08-26-welcome/ tags.yml
 ~/docusaurus-site/blog$ nano 2024-11-02-hf.md
  ~/docusaurus-site/blog$ cat 2024-11-02-hf.md
显示:
---
slug: happy-festival
title: 快乐的节日
tags: [music, life]
date: 2024-11-02 20:16:00
---
此处写正文或html codes.
cd ..
npm run build 
演示网站:https://melodic-frangipane-64fa6e.netlify.app/
https://melodic-frangipane-64fa6e.netlify.app/blog 
项目地址: https://github.com/facebook/docusaurus

Contributing guide

Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Docusaurus.

Beginner-friendly bugs

To help you get your feet wet and get you familiar with our contribution process, we have a list of beginner-friendly bugs that might contain smaller issues to tackle first. This is a great place to get started.

Contact

We have a few channels for contact:

from https://github.com/facebook/docusaurus
-----

https://docusaurus.io/blog
--------

Installation

Docusaurus is essentially a set of npm packages.

Requirements

  • Node.js version 16.14 or above (which can be checked by running node -v). You can use nvm for managing multiple Node versions on a single machine installed.
    • When installing Node.js, you are recommended to check all checkboxes related to dependencies.

Scaffold project website

The easiest way to install Docusaurus is to use the command line tool that helps you scaffold a skeleton Docusaurus website. You can run this command anywhere in a new empty repository or within an existing repository, it will create a new directory containing the scaffolded files.

npx create-docusaurus@latest my-website classic

We recommend the classic template so that you can get started quickly, and it contains features found in Docusaurus 1. The classic template contains @docusaurus/preset-classic which includes standard documentation, a blog, custom pages, and a CSS framework (with dark mode support). You can get up and running extremely quickly with the classic template and customize things later on when you have gained more familiarity with Docusaurus.

You can also use the template's TypeScript variant by passing the --typescript flag. See TypeScript support for more information.

npx create-docusaurus@latest my-website classic --typescript

You can also initialize a new project using your preferred project manager:

npm init docusaurus

Run npx create-docusaurus@latest --help, or check out its API docs for more information about all available flags.

from https://docusaurus.io/docs/installation
https://tutorial.docusaurus.io/docs/intro 
------------------------------------------------  

The open-source repo for docs.halo.run

This website is built using Docusaurus 2, a modern static website generator.

Installation

$ pnpm install 

If you don’t have pnpm installed, you can install it with the following command:

npm install -g pnpm

Local Development

$ pnpm start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

$ pnpm build

This command generates static content into the build directory and can be served using any static contents hosting service.

from https://github.com/halo-dev/docs 

-----------------------------------------------

cd ~

git clone https://github.com/mrbrunelli/blog blog-by-mrbrunelli

cd blog-by-mrbrunelli

$ yarn

$ yarn build

显示:

...

[SUCCESS] Generated static files in build.
...

[SUCCESS] Generated static files in build\en.
[INFO] Use `npm run serve` command to test your build locally.

$ cd blog

$ ls
2021-05-07-o-impacto-da-educacao-em-minha-vida/
2021-12-16-como-contornar-a-dor-de-escrever-um-teste-unitario/
2022-02-19-criando-atalhos-para-o-git/
2022-02-20-aprenda-a-criar-snippets-no-vscode/
2022-02-21-como-validar-dados-de-uma-forma-elegante/
2022-10-17-aprenda-a-testar-pt1/
2022-10-19-aprenda-a-testar-pt2/
2023-06-12-dicas-para-melhorar-as-chances-em-entrevistas/
2023-10-04-nao-espere-um-ambiente-favoravel-para-fazer-algo-com-qualidade/
authors.yml

12799@DESKTOP-B6LK9IO MINGW64 ~/blog-by-mrbrunelli/blog (master)
$ cd 2022-10-17-aprenda-a-testar-pt1/
$ ls
index.md
 $ cd ..

~/blog-by-mrbrunelli/blog (master)$ mkdir 2024-11-02-happy-festival/
~/blog-by-mrbrunelli/blog (master)$ cd 2024-11-02-happy-festival/
~/blog-by-mrbrunelli/blog/2024-11-02-happy-festival (master)$ nano index.md

~/blog-by-mrbrunelli/blog/2024-11-02-happy-festival (master)$ cat index.md

显示:

---
slug: happy-festival
title: 快乐的节日
description: 这是一首歌
tags: [music, life, culture]

date: 2024-11-02 21:30:00
---

此处写正文或 html codes.

(如果文章太长,支持在正文里插入截断代码:

<!-- truncate --> )

$ cd  ~/blog-by-mrbrunelli/

$ nano  docusaurus.config.js (把baseUrl的值改为"/")

$ yarn build 

演示网站:https://charming-donut-43dca9.netlify.app/

https://charming-donut-43dca9.netlify.app/en/

项目地址:https://github.com/mrbrunelli/blog


No comments:

Post a Comment