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 1 commit
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
15 changes: 15 additions & 0 deletions docs/publishing/github-pages.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@ 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 domain. First, [set up 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. Next, in the Github repository for your site, edit the domain (Settings > Pages > Custom Domain). Then, add a file called CNAME to the root directory of your project. The only content of the file is the custom domain (e.g., `site.example.com`). Finally, add the `site-url` and the CNAME file to your `_quarto.yml` file like this:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next, in the Github repository for your site, edit the domain (Settings > Pages > Custom Domain).

I wonder if there's a slightly cleaner way to provide the expected navigation here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't think of anything simpler, but happy to change it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that being a little more explicit would help, something like

Next, change the configuration on GitHub. In the webpage for your GitHub repository, click on "Settings", "Pages", and "Custom Domain", then enter the domain name in the text field.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Good advice. I changed that, but the paragraph started to feel unwieldy, so I changed it to a numbered list.


``` {.yaml filename="_quarto.yml"}
project:
type: website
cscheid marked this conversation as resolved.
Show resolved Hide resolved

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