docsify使用配置

docsify是一个类似gitbook的工作,看了1小时文档和网上资料,亲测可用的配置


<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>nonolivetitle>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="description" content="Description">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
head>
<body>
  <div id="app">loading...div>
  <script>
    window.$docsify = {
      
      name: '大数据成长',//侧边栏标题
      loadNavbar: true,//顶部导航
      loadSidebar: true, // 加载自定义侧边栏
      maxLevel: 4, // 默认情况下会抓取文档中所有标题渲染成目录,可配置最大支持渲染的标题层级。
      subMaxLevel: 5, // 生成目录的最大层级
      mergeNavbar: true, // 小屏设备下合并导航栏到侧边栏
      alias: {
       // 定义路由别名,可以更自由的定义路由规则。 支持正则
        '/.*/_sidebar.md': '/_sidebar.md'//防止意外回退
      },
      count:{
      
        countable:true,
        fontsize:'0.9em',
        color:'rgb(90,90,90)',
        language:'chinese'
      },
      search: {
       // default默认搜索
        placeholder: '搜索',
        noData: '找不到结果!',
        depth: 3
      }	  
    } 
  script>
  <script src="//unpkg.com/docsify/lib/docsify.min.js">script>
  
  <script src="//unpkg.com/prismjs/components/prism-java.js">script>
  
  <script src="//unpkg.com/prismjs/components/prism-python.js">script>
  
  <script src="//unpkg.com/prismjs/components/prism-sql.js">script>
  
  <script src="//unpkg.com/prismjs/components/prism-bash.js">script>
  
  <script src="//unpkg.com/docsify/lib/plugins/search.js">script>
  
  <script src="//unpkg.com/npm/docsify-copy-code">script>
  
  <script src="//unpkg.com/docsify-count/dist/countable.js">script>
  
  <script src="//cdn.jsdelivr.net/npm/docsify-pagination/dist/docsify-pagination.min.js">script>
  
  <script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/zoom-image.min.js">script>
body>
html>

部署

nginx部署
由于都是静态文件,所以可以直接挂到nginx下面
步骤如下:

(1)安装nginx:yum install nginx

nginx -s stop // 先停止nginx
配置:vi /etc/nginx/nginx.conf,如下图,这里我直接将静态文件放到 /usr/share/nginx/html 下,端口号改为了8000
nginx -s reload
(2)检查nginx配置: nginx -t

(3)启动nginx:systemctl start nginx

nginx常用命令:

重启: systemctl reload nginx

查找nginx安装目录:rpm -ql nginx

查找nginx有没有启动: netstat -anp |grep :80

ps -ef|grep nginx

查看错误日志

cat /var/log/nginx/error.log

service nginx restart
service nginx status

你可能感兴趣的:(docsify,gitbook,博客)