confluence static site
2.3.0
npm install @labset/confluence-static-site --save-dev
yarn add @labset/confluence-static-site -D
./node_modules/.bin/confsite env
./node_modules/.bin/confsite init-site < name >
它创建一个具有以下属性的.env
文件
CONFLUENCE_SITE_NAME
:您要从中生成站点的 Confluence 云实例CONFLUENCE_USERNAME
:用于使用 Confluence API 的用户名CONFLUENCE_API_TOKEN
:使用 Confluence API 的用户个人访问令牌TARGET_SITE
:托管您生成的网站的域名TWITTER_SITE
:用于 seo 目的的 Twitter 句柄GOOGLE_ANALYTICS_TRACKING_ID
:Google Analytics 跟踪 ID ./node_modules/.bin/confsite config
它使用以下配置创建一个.confluence-static-site.json
文件
{
"title" : " confluence-static-site " ,
"iconUrl" : " " ,
"name" : " space name " ,
"theme" : {
"name" : " confluence-static-site " ,
"backgroundColor" : " rgb(0, 102, 68) " ,
"highlightColor" : " #FFFFFF "
}
}
./node_modules/.bin/confsite extract < spaceKey >
./node_modules/.bin/confsite extract-emojis < spaceKey >
./node_modules/.bin/confsite build < spaceKey >
./node_modules/.bin/confsite build < spaceKey > --serve # with webpack dev server
./node_modules/.bin/confsite build < spaceKey > --assets my-assets-folder # copy your assets to the site output assets (i.e. site logo ...)
提取内容并构建站点后,您将在项目文件夹的根目录中创建一个具有以下结构的output
目录
- output
- site
- <spaceKey>
- articles
- <blog-title-1>
- <blog-title-2>
- ...
- assets
- avatars
- emojis
- attachments
- notes
- <page-title-1>
- <page-title-2>
- ...
- object-resolver
- templates
您需要部署的是output/site/<spaceKey>