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
+34-2Lines changed: 34 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,11 @@ There are three ways to publish Quarto websites and documents to GitHub Pages:
15
15
16
16
2. Use the `quarto publish` command to publish content rendered on your local machine.
17
17
18
-
3. Use a [GitHub Action] to automatically render your files (a single Quarto document or a Quarto project) and publish the resulting content whenever you push a source code change to your repository.
18
+
3. Use a [GitHub Action](#github-action) to automatically render your files (a single Quarto document or a Quarto project) and publish the resulting content whenever you push a source code change to your repository.
19
19
20
20
We'll cover each of these methods below, but first an important pre-requisite: you need to have a Git repository on your local machine that is synced to GitHub. The URL of the published website will be derived from the combination of your username and the repository name (e.g. `https://username.github.io/reponame/`).
21
21
22
-
You can optionally configure a [custom domain](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages) for a GitHub Pages site, but before exploring that ground you should get your site up and running with the default domain.
22
+
You can optionally configure a [custom domain](#custom-domain) for a GitHub Pages site, but before exploring that, get your site up and running with the default domain.
23
23
24
24
## Render to `docs` {#render-to-docs}
25
25
@@ -283,6 +283,38 @@ By default, `quarto publish` will re-render your project before publishing it. H
283
283
284
284
See the full definition of the Quarto [publish action](https://github.com/quarto-dev/quarto-actions/blob/main/publish/action.yml) to learn about other more advanced options.
285
285
286
+
## Custom Domain {#custom-domain}
287
+
288
+
A custom domain allows you to use your own domain name instead of the default `username.github.io` domain for your GitHub Pages site.
289
+
To use a custom domain you need to complete two steps:
290
+
291
+
1. Add your domain to your GitHub repository settings
292
+
2. Configure a record with your DNS provider
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`):
298
+
299
+
::: {layout-ncol="2"}
300
+
301
+
```{.default filename="website/"}
302
+
├── _site/
303
+
├── _quarto.yml
304
+
├── CNAME
305
+
├── about.qmd
306
+
└── index.qmd
307
+
```
308
+
309
+
```{.default filename="CNAME"}
310
+
blog.example.com
311
+
```
312
+
::::
313
+
314
+
Commit `CNAME`, and push it to GitHub before completing the second step.
315
+
316
+
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).
317
+
286
318
## User Site
287
319
288
320
In addition to creating sites tied to various repositories, you can also create a user site that is served from your root user domain (e.g. `https://username.github.io`). This is an ideal place to publish a blog or personal home page. To create a user site:
0 commit comments