Skip to content

Commit

Permalink
feat: support cname for docs publishing (#1442)
Browse files Browse the repository at this point in the history
Expose the `cname` option from `gh-pages` to support publishing docs on a custom domain.
  • Loading branch information
achingbrain authored Jan 8, 2024
1 parent dd98696 commit b705c13
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/cmds/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ export default {
type: 'string',
describe: 'Where to build the documentation',
default: userConfig.docs.directory
},
cname: {
type: 'string',
describe: 'A custom domain pointed at the gh-pages branch',
default: userConfig.docs.cname
}
})
},
Expand Down
4 changes: 3 additions & 1 deletion src/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ async function findMonorepoEntryPoints () {
* @property {string} PublishDocsConfig.email
* @property {string} PublishDocsConfig.message
* @property {string} PublishDocsConfig.directory
* @property {string} [PublishDocsConfig.cname]
*/

/**
Expand All @@ -138,7 +139,8 @@ const publishDocs = async (config) => {
user: {
name: config.user,
email: config.email
}
},
cname: config.cname
}
)
}
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ interface DocsOptions {
* Where to build the documentation
*/
directory: string
/**
* If set a CNAME file will be written with a custom domain
*/
cname?: string
}

interface DocsVerifierOptions {
Expand Down

0 comments on commit b705c13

Please sign in to comment.