Skip to content

Commit b705c13

Browse files
authored
feat: support cname for docs publishing (#1442)
Expose the `cname` option from `gh-pages` to support publishing docs on a custom domain.
1 parent dd98696 commit b705c13

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/cmds/docs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ export default {
5555
type: 'string',
5656
describe: 'Where to build the documentation',
5757
default: userConfig.docs.directory
58+
},
59+
cname: {
60+
type: 'string',
61+
describe: 'A custom domain pointed at the gh-pages branch',
62+
default: userConfig.docs.cname
5863
}
5964
})
6065
},

src/docs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ async function findMonorepoEntryPoints () {
120120
* @property {string} PublishDocsConfig.email
121121
* @property {string} PublishDocsConfig.message
122122
* @property {string} PublishDocsConfig.directory
123+
* @property {string} [PublishDocsConfig.cname]
123124
*/
124125

125126
/**
@@ -138,7 +139,8 @@ const publishDocs = async (config) => {
138139
user: {
139140
name: config.user,
140141
email: config.email
141-
}
142+
},
143+
cname: config.cname
142144
}
143145
)
144146
}

src/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ interface DocsOptions {
170170
* Where to build the documentation
171171
*/
172172
directory: string
173+
/**
174+
* If set a CNAME file will be written with a custom domain
175+
*/
176+
cname?: string
173177
}
174178

175179
interface DocsVerifierOptions {

0 commit comments

Comments
 (0)