Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update github-pages.qmd to include instructions for custom domains #1298

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/publishing/github-pages.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,23 @@ If you are publishing to a private (i.e. password protected) website then the lo
quarto publish gh-pages --no-browser
```

#### Custom Domains

There are a few steps you will need to take to publish to a custom subdomain, such as publishing a website to `site.example.com` instead of `www.example.com/repo-name`:

1. [Create a CNAME record](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-a-subdomain) with your DNS provider.
2. Change the configuration on GitHub. Open the webpage for your GitHub repository, click on "Settings", then "Pages", then "Custom Domain", and enter the domain name in the text field (e.g., `site.example.com`).
3. Create a file called CNAME in the root directory of your project; the only content of the CNAME file is the custom domain (e.g., `site.example.com`).
4. Add the `site-url` and the CNAME file to your `_quarto.yml` file like this:

``` {.yaml filename="_quarto.yml"}
resources:
- "CNAME"

website:
site-url: "site.example.com"
```

#### Documents

To publish a document rather than a website or book, provide the path to the document (note that you can publish only one document from a given GitHub repository):
Expand Down