You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/publishing/github-pages.qmd
+22-9Lines changed: 22 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -289,12 +289,11 @@ A custom domain allows you to use your own domain name instead of the default `u
289
289
To use a custom domain you need to complete two steps:
290
290
291
291
1. Add your domain to your GitHub repository settings
292
-
2. Configure a record with your DNS provider
292
+
2. Configure records with your DNS provider
293
293
294
-
For the first step, the [GitHub Pages documentation](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site) describes adding your domain to your repository in the **Settings** pane.
295
-
However, this creates a `CNAME` file in the location of your rendered site,
296
-
which will be overwritten whenever you render your site.
297
-
Instead, create a `CNAME` file manually in your project root directory (i.e. alongside `_quarto.yml`):
294
+
### 1. Add your domain to your GitHub repository settings
295
+
296
+
Add a `CNAME` file to your project root directory (i.e. alongside `_quarto.yml`) that contains your custom domain:
298
297
299
298
::: {layout-ncol="2"}
300
299
@@ -311,11 +310,25 @@ blog.example.com
311
310
```
312
311
::::
313
312
314
-
Quarto recognizes the `CNAME` file as a [site resource](/docs/websites/website-tools.qmd#site-resources) and will copy it your site output directory when you render.
315
-
Commit `CNAME` (and `docs/CNAME`, if you are publishing from `docs/`),
316
-
and push to GitHub before completing the second step.
313
+
Quarto will recognize the `CNAME` file as a [site resource](/docs/websites/website-tools.qmd#site-resources) and will copy it your site output directory when you render.
314
+
315
+
Re-render and publish your site to ensure `CNAME` is available to GitHub.
316
+
317
+
::: {.callout-note}
318
+
319
+
The GitHub Pages documentation describes adding your domain to your repository in the **Settings** pane.
320
+
However, this creates a `CNAME` file in the location of your rendered site,
321
+
which will be overwritten whenever you render your site.
322
+
323
+
:::
324
+
325
+
326
+
### 2. Configure records with your DNS provider
327
+
328
+
The records you need to configure with your DNS provider depend on whether you are using an apex domain (e.g `example.com`) or a subdomain (e.g. `www.example.com` or `blog.example.com`).
317
329
318
-
Learn more about the second step, and troubleshooting tips in the [GitHub Pages documentation](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages).
330
+
Apex domains require an `ALIAS`, `ANAME`, or `A` record, whereas subdomains require a `CNAME` record.
331
+
Find the appropriate values for these records in the [GitHub Pages documentation](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#dns-records-for-your-custom-domain).
0 commit comments