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

Document how to setup custom domain on Github Pages when using quarto publish gh-pages #4941

Open
Tracked by #6204
cderv opened this issue Mar 24, 2023 Discussed in #3249 · 8 comments · May be fixed by quarto-dev/quarto-web#1583
Open
Tracked by #6204

Document how to setup custom domain on Github Pages when using quarto publish gh-pages #4941

cderv opened this issue Mar 24, 2023 Discussed in #3249 · 8 comments · May be fixed by quarto-dev/quarto-web#1583
Assignees
Labels
documentation Doc improvements & quarto-web publishing-github
Milestone

Comments

@cderv
Copy link
Collaborator

cderv commented Mar 24, 2023

Discussed in #3249

Originally posted by jmgirard November 8, 2022
I am hosting a Quarto website on Github Pages using the "docs" method. I have a custom domain and thus need to have a docs/CNAME file in my project. However, it seems that quarto is removing this file whenever I render via quarto render. Is there a way to tell quarto to keep this CNAME file? I tried the website: site-url option but that didn't seem to do it.

This is also from quarto-dev/quarto-actions#73

@cderv cderv added the documentation Doc improvements & quarto-web label Mar 24, 2023
@cderv
Copy link
Collaborator Author

cderv commented Mar 24, 2023

Proposed solution:

  • Add the CNAME file in the root of Quarto project
  • add it as an explicit resource in your _quarto.yml configuration:
resources:
  - CNAME

@allenmanning allenmanning added the good-first-issue Good for newcomers, fairly well defined label Mar 24, 2023
@allenmanning allenmanning added this to the v1.4 milestone Mar 24, 2023
@allenmanning allenmanning removed the good-first-issue Good for newcomers, fairly well defined label Mar 24, 2023
@cwickham
Copy link
Collaborator

Maybe this belongs in https://quarto.org/docs/publishing/github-pages.html#render-to-docs.

But perhaps this is actually an issue for all publishing methods (rendering to docs, quarto publish, and GitHub actions). The Overview mentions custom domains in its final paragraph, so perhaps this really needs to be its own section linked from there.

@cscheid or @cderv could one of you confirm if the proposed solution applies to all publishing methods?

@cscheid
Copy link
Collaborator

cscheid commented Apr 13, 2023

Different publishing targets will generally need different documentation. (eg, quarto pub doesn't support custom domains)

@cwickham
Copy link
Collaborator

I meant just the different methods of publishing GitHub pages (only those discussed on this doc page), as opposed to other publishing venues. I.e. should this exist as a top level section of "GitHub Pages" or as a subsection of the "Render to docs" section on that page.

@docsteveharris
Copy link

I came across this when trying to stop github pages over-writing my custom domain.
See https://stackoverflow.com/a/67184037, and so also would like to know that I can keep a CNAME file in the root.

@mcanouil
Copy link
Collaborator

mcanouil commented May 7, 2023

You need to tell Quarto CNAME file is part of the website/document/book resources, see https://quarto.org/docs/websites/website-tools.html#site-resources.

This was also highlighted in a previous comment, see #4941 (comment).

@mcanouil
Copy link
Collaborator

mcanouil commented Mar 8, 2025

From:

I believe so, because the other issue means to add something in the "publishing" parts of the website.

  • keep the resource example because it shows the resource are not limited to file to be downloaded but also web related files.
  • check/add that CNAME at the root of a Quarto project are automatically added to resources (possibly list other files that have the same treatment somewhere)
  • add the custom domain setup to the relevant "publishing" pages.

I believe, we should use an include here.

@cwickham
Copy link
Collaborator

cwickham commented Mar 11, 2025

Also from quarto-dev/quarto-web#1091:

Others are "robots.txt", ".nojekyll", "CNAME", "_redirects", "404.html"

It makes sense to reiterate these files are automatically detected in https://quarto.org/docs/websites/website-tools.html#site-resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Doc improvements & quarto-web publishing-github
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants