搭建自己的wiki知识库(重新整理)

写在前面:

html 复制代码
之前写过一篇,因为这次修改的内容比较多,所以不想在原基础上修改了,还是重新整理一篇吧。

搭建wiki知识库,可以使用在线文档,如xx笔记、xx文档、xx博客、git仓库(如:GitHub)等等,也可以使用开源的项目搭建,如vuePress、Docusaurus、Hugo、mdBook、Zola、Jekyll、WordPress、Docsify、Hexo等等。

使用某些在线文档可能会存在一些限制。

使用开源项目搭建,需要会一些编程的能力,还要会Markdown的语法。

相对于使用在线文档来说,使用开源的项目,可能一开始接触没那么容易,如果搭建好了,后面也只需关注编写自己的内容就行了,其实也没有那么难。

最后,补充一下,如果使用开源项目搭建的话,可以把文章提交到git仓库(如GitHub、Gitee、私有部署的git仓库等),然后在我们自己的服务器安装好git,拉取git仓库的代码,接着再进行其他操作。这样做只是为了备份,同时也做了版本控制,如果这篇文章做了多次修改,你也可以查看以前修改的内容。如果不想这样操作也没事,我们就正常操作就行了(使用FTP工具上传Markdown文件或者编译后的静态文件)。

下面的内容比较多,可能存在纰漏,如果后面发现问题,会进行相应的修改。

一、使用在线文档

二、使用开源项目

  • Vue编写:VuePress或者VitePress
  • React编写:Docusaurus
  • Go编写:Hugo
  • Rust编写:mdBook、Zola
  • Ruby编写:Jekyll
  • PHP编写:WordPress
  • 其他开源项目:Docsify、Hexo、GitBook等等

Docsify

文档:https://docsify.js.org/#/quickstart

GitHub:https://github.com/docsifyjs/docsify

可以使用npm安装或者直接去github下载。

接下来我们在项目站点创建index.html、_sidebar.md、test.md等文件,然后修改nginx配置,最后重启nginx。

1、创建文件

index.html文件:

html 复制代码
<!-- 更换css、js使用国内cdn资源 -->
<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta charset="UTF-8" />
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/docsify/4.13.0/themes/dark.min.css">
    <title>snail</title>
</head>

<body>
    <div id="app">Loading...</div>
    <script>
        window.$docsify = {
            auto2top: true,
            coverpage: false,
            executeScript: true,
            homepage: '_sidebar.md',
            loadSidebar: true,
            //loadNavbar: false,
            //mergeNavbar: true,
            maxLevel: 4,
            subMaxLevel: 2,
            name: 'docsify',
            nameLink: {
                '/': '#/',
            },
            search: {
                noData: {
                    '/': '没有结果!',
                },
                paths: 'auto',
                placeholder: {
                    '/': '搜索',
                },
            },
        };
    </script>
    <script src="https://cdn.bootcdn.net/ajax/libs/docsify/4.13.0/docsify.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/docsify/4.13.0/plugins/search.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/docsify/4.13.0/plugins/emoji.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/docsify/4.13.0/plugins/zoom-image.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/docsify-copy-code/2.1.1/docsify-copy-code.min.js"></script>
</body>

</html>

_sidebar.md文件:

html 复制代码
- [test](test.md)
- [请手动增加其他md文件,否则删除这行](more.md)

test.md文件:

html 复制代码
hello world

2、启动服务

Nginx配置:

bash 复制代码
location / {
    root   'docsify所在的目录';
    index  index.html index.htm;
 
    #add_header Cache-Control "no-cache, no-store, must-revalidate";
    #add_header Pragma "no-cache";
    #add_header Expires 0;
}

重启Nginx:

bash 复制代码
nginx -s reload

浏览器访问:http://localhost/

GitBook

官网:https://www.gitbook.com/

GitHub:https://github.com/GitbookIO/gitbook

cli工具:https://github.com/GitbookIO/gitbook-cli

VuePress

文档:https://vuepress.vuejs.org/zh/guide/getting-started.html

1、安装

2、创建项目

bash 复制代码
# 命令行创建,进行交互式操作
npm init vuepress vuepress-starter

命令:

bash 复制代码
启动开发服务器:npm run docs:dev 
构建网站:npm run docs:build

目录结构:

bash 复制代码
├─ docs
├─ node_modules
│  ├─ .vuepress
│  │  └─ config.js
│  └─ get-started.md
│  └─ README.md
└─ package.json
└─ package-lock.json

3、启动服务

bash 复制代码
cd vuepress-starter
npm run docs:dev

浏览器访问:http://localhost:8080/

bash 复制代码
如果出现报错:
[plugin:vite:css] Preprocessor dependency "sass-embedded" not found. Did you install it? Try `npm install -D sass-embedded`.

执行命令:npm install -D sass-embedded

4、项目打包

bash 复制代码
# 执行下面命令,在docs/.vuepress/dist目录中可以找到构建生成的静态文件。
npm run docs:build

Hexo

文档:https://hexo.io/zh-cn/docs/

1、安装Hexo

bash 复制代码
npm install hexo-cli -g

2、创建项目

bash 复制代码
# 创建项目
hexo init hexo-blog

# 切换目录
cd hexo-blog

# 下载依赖
npm install

目录结构:

bash 复制代码
├── _config.yml:配置文件
├── package.json
├── scaffolds:模板文件夹
├── source:资源文件夹
|   ├── _drafts
|   └── _posts
└── themes:主题文件夹

3、启动服务

bash 复制代码
hexo server

浏览器访问:http://localhost:4000/

4、项目打包

bash 复制代码
# 执行下面命令,在public目录中可以找到构建生成的静态文件。
hexo generate

Docusaurus

文档:https://docusaurus.io/docs

1、创建项目

bash 复制代码
npm init docusaurus@latest

目录结构:

bash 复制代码
├── blog:包含博客的 Markdown 文件。如果你关闭了博客功能,则可以将此目录删除。
├── docs: 包含文档的 Markdown 文件。
├── src:非文档文件,例如独立页面(pages)或自定义的 React 组件。
│   ├── components
│   ├── css
│   └── pages
├── static:存放静态文件的目录。
├── docusaurus.config.js:包含站点配置的配置文件。
├── package.json
├── package-lock.json
├── README.md
└── sidebars.js:生成文档时使用此文件来指定侧边栏中的文档顺序。

2、启动服务

bash 复制代码
cd docusaurus-demo
npm start

浏览器访问:http://localhost:3000/

3、项目打包

bash 复制代码
# 执行下面命令,在build目录中可以找到构建生成的静态文件。
npm run build

Hugo

1、安装Go

bash 复制代码
# 1、下载
# 下载地址:https://go.dev/dl/
wget https://go.dev/dl/go1.23.3.linux-amd64.tar.gz

# 2、解压
tar -xf go1.23.3.linux-amd64.tar.gz -C /usr/local/

# 3、添加环境变量
# 添加到环境变量,编辑/root/.bash_profile文件,内容如下: 
GO_PATH=/usr/local/go/bin
PATH=$PATH:$HOME/bin:$GO_PATH
export PATH

# 4、使环境变量生效
source /root/.bash_profile

# 5、查看版本
go version

# 6、配置goproxy
go env -w GOPROXY=https://goproxy.cn,direct

2、安装Hugo

文档:https://gohugo.io/documentation/

bash 复制代码
# 1、下载
# hugo-v0.139.0安装包列表:https://github.com/gohugoio/hugo/releases/tag/v0.139.0
wget https://github.com/gohugoio/hugo/releases/download/v0.139.0/hugo_0.139.0_linux-amd64.tar.gz

# 2、解压
tar -xf hugo_0.139.0_linux-amd64.tar.gz

# 3、将hugo文件移动到/usr/local/bin/
mv hugo /usr/local/bin/

命令:

bash 复制代码
hugo is the main command, used to build your Hugo site.

Hugo is a Fast and Flexible Static Site Generator
built with love by spf13 and friends in Go.

Complete documentation is available at https://gohugo.io/.

Usage:
  hugo [flags]
  hugo [command]

Available Commands:
  build       Build your site
  completion  Generate the autocompletion script for the specified shell
  config      Display site configuration
  convert     Convert front matter to another format
  env         Display version and environment info
  gen         Generate documentation and syntax highlighting styles
  help        Help about any command
  import      Import a site from another system
  list        List content
  mod         Manage modules
  new         Create new content
  server      Start the embedded web server
  version     Display version

Flags:
  -b, --baseURL string             hostname (and path) to the root, e.g. https://spf13.com/
  -D, --buildDrafts                include content marked as draft
  -E, --buildExpired               include expired content
  -F, --buildFuture                include content with publishdate in the future
      --cacheDir string            filesystem path to cache directory
      --cleanDestinationDir        remove files from destination not found in static directories
      --clock string               set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
      --config string              config file (default is hugo.yaml|json|toml)
      --configDir string           config dir (default "config")
  -c, --contentDir string          filesystem path to content directory
  -d, --destination string         filesystem path to write files to
      --disableKinds strings       disable different kind of pages (home, RSS etc.)
      --enableGitInfo              add Git revision, date, author, and CODEOWNERS info to the pages
  -e, --environment string         build environment
      --forceSyncStatic            copy all files when static is changed.
      --gc                         enable to run some cleanup tasks (remove unused cache files) after the build
  -h, --help                       help for hugo
      --ignoreCache                ignores the cache directory
      --ignoreVendorPaths string   ignores any _vendor for module paths matching the given Glob pattern
  -l, --layoutDir string           filesystem path to layout directory
      --logLevel string            log level (debug|info|warn|error)
      --minify                     minify any supported output format (HTML, XML etc.)
      --noBuildLock                don't create .hugo_build.lock file
      --noChmod                    don't sync permission mode of files
      --noTimes                    don't sync modification time of files
      --panicOnWarning             panic on first WARNING log
      --poll string                set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
      --printI18nWarnings          print missing translations
      --printMemoryUsage           print memory usage to screen at intervals
      --printPathWarnings          print warnings on duplicate target paths etc.
      --printUnusedTemplates       print warnings on unused templates.
      --quiet                      build in quiet mode
      --renderSegments strings     named segments to render (configured in the segments config)
  -M, --renderToMemory             render to memory (mostly useful when running the server)
  -s, --source string              filesystem path to read files relative from
      --templateMetrics            display metrics about template executions
      --templateMetricsHints       calculate some improvement hints when combined with --templateMetrics
  -t, --theme strings              themes to use (located in /themes/THEMENAME/)
      --themesDir string           filesystem path to themes directory
      --trace file                 write trace to file (not useful in general)
  -w, --watch                      watch filesystem for changes and recreate as needed

Use "hugo [command] --help" for more information about a command.

3、创建项目

bash 复制代码
hugo new site hugo-demo

显示内容:

bash 复制代码
Congratulations! Your new Hugo site was created in /root/hugo-demo.

Just a few more steps...

1. Change the current directory to /root/hugo-demo.
2. Create or install a theme:
   - Create a new theme with the command "hugo new theme <THEMENAME>"
   - Or, install a theme from https://themes.gohugo.io/
3. Edit hugo.toml, setting the "theme" property to the theme name.
4. Create new content with the command "hugo new content <SECTIONNAME>/<FILENAME>.<FORMAT>".
5. Start the embedded web server with the command "hugo server --buildDrafts".

See documentation at https://gohugo.io/.
[root@localhost ~]# cd hugo-demo/
[root@localhost hugo-demo]# hugo new about.md
Content "/root/hugo-demo/content/about.md" created

目录结构:

bash 复制代码
详见:https://gohugo.io/getting-started/directory-structure/

├── archetypes/
│   └── default.md
├── assets/
├── content/
├── data/
├── i18n/
├── layouts/
├── static/
├── themes/
└── hugo.toml         <-- site configuration

创建about页面:

bash 复制代码
# 1、切换目录
cd hugo-demo

# 2、创建页面
hugo new about.md

# 提示内容:Content "/root/hugo-demo/content/about.md" created

about.md内容:

html 复制代码
+++
draft = false
title = 'About'
+++

hello world

安装皮肤:

bash 复制代码
# 主题列表地址:https://themes.gohugo.io/

yum -y install git
cd themes
git clone https://github.com/spf13/hyde.git

4、启动服务

bash 复制代码
hugo server --theme=hyde

# 示例:hugo server --theme=hyde --baseURL "192.168.186.130" --bind "0.0.0.0" -p 1313

浏览器访问:http://localhost:1313/

5、项目打包

bash 复制代码
# 执行 Hugo 命令生成最终页面
# 同时会创建public目录,该目录为生成的页面
# 我们可以将public目录的内容部署到nginx中

hugo --theme=hyde

# 或者
hugo build

mdBook

1、安装Rust

文档:https://www.rust-lang.org/learn/get-started

配置镜像:

详见:https://course.rs/first-try/slowly-downloading.html

创建/root/.cargo/config.toml文件:

bash 复制代码
# 创建/root/.cargo/config.toml文件
# 选择镜像源,没有注释掉的那个就是你选择的
#replace-with = 'ustc'
#replace-with = 'tuna'
#replace-with = 'sjtu'
#replace-with = 'rustcc'
replace-with = 'aliyun'
 
# ----------源码地址----------
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
 
# ----------镜像地址----------
# 清华大学
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"

# 中国科学技术大学
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

# 上海交通大学
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"

# rustcc社区
[source.rustcc]
registry = "git://crates.rustcc.cn/crates.io-index"

# 阿里云
[source.aliyun]
registry = "https://code.aliyun.com/rustcc/crates.io-index"

安装:

bash 复制代码
# 1、安装
# rust安装说明:https://www.rust-lang.org/tools/install
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# 2、执行命令的结果如下:
中途需要选择
1) Proceed with installation (default) =》默认安装
2) Customize installation              =》自定义安装
3) Cancel installation                 =》取消安装

# 3、直接回车(选择默认安装),接下来下载cargo、clippy、rust-docs、rust-std、rustc、rustfmt等组件。

# 4、最后执行命令: 
source "$HOME/.cargo/env"

命令:

bash 复制代码
cargo build:构建项目
cargo run:运行项目
cargo test:测试项目
cargo doc:为项目构建文档
cargo publish:发布库
cargo --version:查看版本

2、安装mdBook

安装:

bash 复制代码
# 1、下载
# mdBook下载地址:https://github.com/rust-lang/mdBook/releases
wget https://github.com/rust-lang/mdBook/archive/refs/tags/v0.4.42.tar.gz

# 2、解压
tar -xf v0.4.42.tar.gz

# 3、切换目录
cd mdBook-0.4.42

# 4、构建项目
# cargo run,生成mdbook文件在当前目录下的target/debug/mdbook
# cargo build --release,生成mdbook文件在当前目录下的target/release/mdbook
cargo build --release

# 5、复制mdbook到/usr/local/bin/目录下
cp target/release/mdbook /usr/local/bin/

命令:

bash 复制代码
Creates a book from markdown files

Usage: mdbook [COMMAND]

Commands:
  init         Creates the boilerplate structure and files for a new book
  build        Builds a book from its markdown files
  test         Tests that a book's Rust code samples compile
  clean        Deletes a built book
  completions  Generate shell completions for your shell to stdout
  watch        Watches a book's files and rebuilds it on changes
  serve        Serves a book at http://localhost:3000, and rebuilds it on changes
  help         Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

3、创建项目

bash 复制代码
mdbook init mybook

4、启动服务

bash 复制代码
# https://rust-lang.github.io/mdBook/cli/serve.html
mdbook serve mybook -p 3000 -n 0.0.0.0

浏览器访问:http://localhost:3000/

5、项目打包

bash 复制代码
# 执行下面命令,在book目录中可以找到构建生成的静态文件。
mdbook build

6、其他文档

Zola

官网:https://www.getzola.org/

文档:https://www.getzola.org/documentation/getting-started/overview/

安装说明:https://www.getzola.org/documentation/getting-started/installation/

1、安装

在安装mdBook的时候,我们已经安装好了Rust and Cargo,所以省略这一步操作。

bash 复制代码
# 1、下载
wget https://github.com/getzola/zola/archive/refs/tags/v0.19.2.tar.gz

# 2、解压
tar -xf v0.19.2.tar.gz

# 3、切换目录
cd zola-0.19.2

# 4、构建项目
# 4.1、方式1
cargo install --path . --locked

# 4.2、方式2
cargo build --release --locked --no-default-features --features=native-tls

# 执行完4.2的操作后,执行下面命令
cp target/release/zola ~/.cargo/bin/zola
或者
cp target/release/zola /usr/local/bin/

报错:

bash 复制代码
# 报错信息:
The following warnings were emitted during compilation:

warning: libwebp-sys@0.9.5: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.9.5/vendor/src/enc/vp8l_enc.c: In function 'EncoderAnalyze':
warning: libwebp-sys@0.9.5: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.9.5/vendor/src/enc/vp8l_enc.c:328:13: error: 'for' loop initial declarations are only allowed in C99 mode
warning: libwebp-sys@0.9.5:              for (int sorting_method = 0; sorting_method < kPaletteSortingNum;
warning: libwebp-sys@0.9.5:              ^
warning: libwebp-sys@0.9.5: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.9.5/vendor/src/enc/vp8l_enc.c:328:13: note: use option -std=c99 or -std=gnu99 to compile your code
warning: libwebp-sys@0.9.5: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "/root/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.9.5/vendor" "-Wall" "-Wextra" "-fvisibility=hidden" "-Wall" "-DNDEBUG=1" "-D_THREAD_SAFE=1" "-DWEBP_HAVE_SSE2=1" "-o" "/root/zola-0.19.2/target/release/build/libwebp-sys-7c3b8e7fc5aee1e9/out/ec912cc30e018f5e-vp8l_enc.o" "-c" "/root/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.9.5/vendor/src/enc/vp8l_enc.c" with args cc did not execute successfully (status code exit status: 1).

error: failed to run custom build command for `libwebp-sys v0.9.5`


# 处理报错:
1、编辑文件:
      /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.9.5/vendor/src/enc/vp8l_enc.c
2、修改第328行内容:
      修改前:
            //for (int sorting_method = 0; sorting_method < kPaletteSortingNum;
      修改后:
            int sorting_method;
            //for (int sorting_method = 0; sorting_method < kPaletteSortingNum;
            for (sorting_method = 0; sorting_method < kPaletteSortingNum;

补充(忽略这步操作):

bash 复制代码
# -------------------------------------------------------------------------------------------
# 安装libwebp
# -------------------------------------------------------------------------------------------

# 方式1:
yum install -y libwebp libwebp-devel libwebp-tools

# 方式2:
# Cargo Doc:https://docs.rs/
# 下载地址:https://developers.google.com/speed/webp/download
# 下载列表:https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html
# 安装文档:https://github.com/webmproject/libwebp/blob/main/doc/building.md

# 1、安装依赖
yum install libjpeg-devel libpng-devel libtiff-devel libgif-devel

# 2、下载
wget https://github.com/webmproject/libwebp/archive/refs/tags/v1.4.0.tar.gz

# 3、解压
tar -xf v1.4.0.tar.gz

# 4、切换目录 
cd libwebp-1.4.0

# 5、生成可执行配置文件
./autogen.sh

# 6、配置
./configure --enable-libwebpdecoder --enable-libwebpextras

# 7、编译
make

# 8、安装
make install

命令:

bash 复制代码
A fast static site generator with everything built-in

Usage: zola [OPTIONS] <COMMAND>

Commands:
  init        Create a new Zola project
  build       Deletes the output directory if there is one and builds the site
  serve       Serve the site. Rebuild and reload on change automatically
  check       Try to build the project without rendering it. Checks links
  completion  Generate shell completion
  help        Print this message or the help of the given subcommand(s)

Options:
  -r, --root <ROOT>      Directory to use as root of project [default: .]
  -c, --config <CONFIG>  Path to a config file other than config.toml in the root of project [default: config.toml]
  -h, --help             Print help
  -V, --version          Print version

2、创建项目

bash 复制代码
# 创建项目
zola init zola-demo

# 显示内容
Welcome to Zola!
Please answer a few questions to get started quickly.
Any choices made can be changed by modifying the `config.toml` file later.
> What is the URL of your site? (https://example.com): 
> Do you want to enable Sass compilation? [Y/n]: 
> Do you want to enable syntax highlighting? [y/N]: 
> Do you want to build a search index of the content? [y/N]: 

Done! Your site was created in /root/zola-demo

Get started by moving into the directory and using the built-in server: `zola serve`
Visit https://www.getzola.org for the full documentation.

切换目录:

bash 复制代码
cd zola-demo/

目录结构:

bash 复制代码
├── config.toml
├── content
├── sass
├── static
├── templates
└── themes

3、启动服务

bash 复制代码
zola serve -i 0.0.0.0 -p 1111

浏览器访问:http://localhost:1111/

4、项目打包

bash 复制代码
# 执行下面命令,在public目录中可以找到构建生成的静态文件。
zola build

Jekyll

官网:https://jekyllrb.com/

文档:https://jekyllrb.com/docs/

1、安装Ruby

bash 复制代码
# 详见:https://www.ruby-lang.org/en/documentation/installation/#yum
# 直接使用yum安装ruby,可能在使用gem命令时显示版本过低
# sudo yum install -y ruby ruby-devel
# 所以还是使用源码编译安装ruby

# https://github.com/ruby/ruby/blob/master/doc/contributing/building_ruby.md

安装:

bash 复制代码
# 1、下载
wget https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.6.tar.gz

# 2、解压
tar -xf ruby-3.3.6.tar.gz

# 3、编译
# 详见:https://www.ruby-lang.org/en/documentation/installation/#building-from-source
./configure
make
sudo make install

# 4、查看版本
/usr/local/bin/ruby -v

报错:

bash 复制代码
# 报错信息:
To eliminate this warning, please install libyaml and reinstall your ruby.


# 处理报错:
# 文档:http://pyyaml.org/wiki/LibYAML
# github:https://github.com/yaml/libyaml/

# 1、下载
wget http://pyyaml.org/download/libyaml/yaml-0.2.5.tar.gz

# 2、解压
tar -xf yaml-0.2.5.tar.gz

# 3、切换目录
cd yaml-0.2.5

# 4、配置、编译、安装
./configure
make
make install

完成处理报错后,再次执行编译操作:

bash 复制代码
make clean
./configure
make
sudo make install

2、安装RubyGems

文档:https://rubygems.org/pages/download

bash 复制代码
# 1、下载
wget https://rubygems.org/rubygems/rubygems-3.5.23.tgz

# 2、解压
tar -xf rubygems-3.5.23.tgz

# 3、切换目录
cd rubygems-3.5.23

# 4、安装
/usr/local/bin/ruby setup.rb

# 5、查看版本
/usr/local/bin/gem -v

3、安装Jekyll

文档:https://jekyllrb.com/docs/

bash 复制代码
gem install bundler jekyll

命令:

bash 复制代码
A subcommand is required. 
jekyll 4.3.4 -- Jekyll is a blog-aware, static site generator in Ruby

Usage:

  jekyll <subcommand> [options]

Options:
        -s, --source [DIR]  Source directory (defaults to ./)
        -d, --destination [DIR]  Destination directory (defaults to ./_site)
            --safe         Safe mode (defaults to false)
        -p, --plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]  Plugins directory (defaults to ./_plugins)
            --layouts DIR  Layouts directory (defaults to ./_layouts)
            --profile      Generate a Liquid rendering profile
        -h, --help         Show this message
        -v, --version      Print the name and version
        -t, --trace        Show the full backtrace when an error occurs

Subcommands:
  compose               
  docs                  
  import                
  build, b              Build your site
  clean                 Clean the site (removes site output and metadata file) without building.
  doctor, hyde          Search site and print specific deprecation warnings
  help                  Show the help message, optionally for a given subcommand.
  new                   Creates a new Jekyll site scaffold in PATH
  new-theme             Creates a new Jekyll theme scaffold
  serve, server, s      Serve your site locally

4、创建项目

bash 复制代码
# 创建项目
jekyll new jekyll-demo

# 切换目录
cd jekyll-demo

5、启动服务

bash 复制代码
# bundle exec jekyll serve
# jekyll serve --help

bundle exec jekyll serve -H 0.0.0.0 -P 4000

浏览器访问:http://localhost:4000/

6、项目打包

bash 复制代码
jekyll build

WordPress

详见:

云服务器 手动搭建 WordPress 个人站点(Linux)-实践教程-文档中心-腾讯云
搭建WordPress_云服务器 ECS(ECS)-阿里云帮助中心

bash 复制代码
简单说明一下:
1、安装Nginx、PHP、MySQL等软件
2、在Nginx的html目录下创建WordPress项目文件夹(用于存放WordPress代码)
3、在Nginx增加WordPress配置
4、在浏览器访问WordPress站点
相关推荐
杨浦老苏2 个月前
无数据库开源Wiki引擎WikiDocs
docker·markdown·群晖·wiki
vvw&3 个月前
在 Ubuntu 上部署 MediaWiki 开源维基平台
linux·运维·服务器·ubuntu·开源·wiki·mediawiki
杨浦老苏8 个月前
开源协作wiki和文档软件Docmost
docker·在线文档·markdown·群晖·wiki
王者鳜錸10 个月前
私有服务器搭建WIKI与JIRA
运维·服务器·jira·wiki
janthinasnail1 年前
搭建自己的wiki知识库【转】
wiki
freesharer1 年前
开源 Wiki 软件 wiki.js
markdown·知识库·wiki