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>