From d9a20eed4b8871f13c64057d0323575c2f3ffa98 Mon Sep 17 00:00:00 2001 From: Jeremy Foote Date: Tue, 20 Aug 2024 14:21:56 -0400 Subject: [PATCH 1/3] Update github-pages.qmd Adding instructions for publishing to custom domains. --- docs/publishing/github-pages.qmd | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/publishing/github-pages.qmd b/docs/publishing/github-pages.qmd index d0f1d77019..0d5adc3d00 100644 --- a/docs/publishing/github-pages.qmd +++ b/docs/publishing/github-pages.qmd @@ -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: + +``` {.yaml filename="_quarto.yml"} +project: + type: website + +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): From 041f9476a441072802cbf5dff5ef95356394ff98 Mon Sep 17 00:00:00 2001 From: Jeremy Foote Date: Wed, 21 Aug 2024 10:25:39 -0400 Subject: [PATCH 2/3] Update github-pages.qmd for custom domains Responding to code review, trying to simplify instructions. --- docs/publishing/github-pages.qmd | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/publishing/github-pages.qmd b/docs/publishing/github-pages.qmd index 0d5adc3d00..77a7ff1ff4 100644 --- a/docs/publishing/github-pages.qmd +++ b/docs/publishing/github-pages.qmd @@ -105,12 +105,9 @@ 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: +There are a few steps you will need to take to publish to a custom domain. First, [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. Next, in the Github repository for your site, edit the domain (Settings > Pages > Custom Domain). Then, 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`). Finally, add the `site-url` and the CNAME file to your `_quarto.yml` file like this: ``` {.yaml filename="_quarto.yml"} -project: - type: website - resources: - "CNAME" From 79149b2177c3792560b2d63729dd69c653e492f2 Mon Sep 17 00:00:00 2001 From: Jeremy Foote Date: Wed, 21 Aug 2024 11:01:15 -0400 Subject: [PATCH 3/3] Update github-pages.qmd Added more detail about subdomains, changed to numbered steps as paragraph was becoming unwieldy. --- docs/publishing/github-pages.qmd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/publishing/github-pages.qmd b/docs/publishing/github-pages.qmd index 77a7ff1ff4..59fc75ffb9 100644 --- a/docs/publishing/github-pages.qmd +++ b/docs/publishing/github-pages.qmd @@ -105,7 +105,12 @@ 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, [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. Next, in the Github repository for your site, edit the domain (Settings > Pages > Custom Domain). Then, 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`). Finally, add the `site-url` and the CNAME file to your `_quarto.yml` file like this: +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: