Docusaurus: Add setting to prevent publish script from deleting CNAME file

Created on 7 Feb 2019  路  5Comments  路  Source: facebook/docusaurus

馃殌 Feature

Add setting to prevent publish script from deleting CNAME (and potentially other) files.

Have you read the Contributing Guidelines on issues?

Yes

Motivation

When setting up gh-pages with a custom domain name I need to add a CNAME file (It's also possible my website setup is wrong...but it works). Every time I publish the gh-pages gets completely rewritten and I have to add back the CNAME file in a separate commit. It would be nice if this didn't happen.

Here's an example where I keep having to add it back: https://github.com/facebookexperimental/reason-native/commits/gh-pages

Pitch

Let's people use docusaurus with custom domains easier

Most helpful comment

Perfect I will try this. I would recommend adding a brief mention of this option to the "publishing your site docs" so it is more discoverable. Probably near the end of this section: https://docusaurus.io/docs/en/publishing#using-github-pages

Where custom domains are mentioned: "(but it can also be accessed via https://docusaurus.io/ because of a CNAME),"

All 5 comments

Hmmm.. Here is gh-pages for Docusaurus - https://github.com/facebook/Docusaurus/tree/gh-pages

The CNAME file hasn't changed in a year.

I wonder if something is missing in the way you are running this.

cc @yangshun

@kyldvs Try using the cname field in siteConfig.js rather than adding your own CNAME file. Difference being we'll generate the CNAME file for you during build and you don't have to provide your own file.

We do that for Docusaurus.

That should help you do what you need.

Oh - I thought he was using that :) yeah, that should fix it

Sent with GitHawk

Perfect I will try this. I would recommend adding a brief mention of this option to the "publishing your site docs" so it is more discoverable. Probably near the end of this section: https://docusaurus.io/docs/en/publishing#using-github-pages

Where custom domains are mentioned: "(but it can also be accessed via https://docusaurus.io/ because of a CNAME),"

I'll do that. Thanks for the suggestion 馃槃

Was this page helpful?
0 / 5 - 0 ratings