book.json 配置 & 插件

{
    "title": "wxgBlog",
    "author": "wxg",
    "description": "记录分享个人技术和生活感悟",
    "language": "zh-hans",
    "gitbook": "3.2.3",
    "styles": {
        "website": "book.css"
    },
    "lin
    },
    "links": {
        "sidebar": {
            "我的博客": "https://wangxiaogang0629.github.io/blog/index.html"
        }
    },
    "plugins": [
        "expandable-chapters-small",
        "icp",
        "code",
        "back-to-top-button",
        "pageview-count"
    ]
}

plugins

"expandable-chapters-small" // 菜单
"icp" // 备案
"code" // 代码粘贴
"back-to-top-button" // 回到顶部
"pageview-count" // 页面浏览量统计
"anchor-navigation-ex" // 浮层目录
"tbfed-pagefooter" // 底部版权、文件修订时间

安装插件 npm i

npm i gitbook-plugin-expandable-chapters-small gitbook-plugin-code gitbook-plugin-ic
p gitbook-plugin-back-to-top-button gitbook-plugin-pageview-count gitbook-plugin-anchor-navigation-ex

anchor-navigation-ex 配置文档

自定义全局样式

  • 在项目根目录下创建css文件,然后在book.json 中引入
/* 固定显示文章目录,并设置最小宽度 */
#anchor-navigation-ex-navbar ul {
    min-width: 240px !important;
    display: block !important;
}
// book.json
"styles": {
    "website": "book.css"
},
powered by Gitbook该文件修订时间: 2023-08-25 19:43:20

results matching ""

    No results matching ""