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

docs: add a CNAME example for site resources #1091

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mcanouil
Copy link
Contributor

@mcanouil mcanouil commented Apr 26, 2024

This pull request adds an example in the documentation for including a CNAME file in the resources list in the _quarto.yml configuration file.

This better illustrate that resources can be used more widely and in a more web driven way, such as publishing using domain, etc.

FYI: quarto-dev/quarto-cli#5341

@cderv
Copy link
Collaborator

cderv commented Apr 26, 2024

/deploy-preview

@cderv
Copy link
Collaborator

cderv commented Apr 26, 2024

I think CNAME is among the files that we will detect by default in a project and consider as resources to move in the output dir
https://github.com/quarto-dev/quarto-cli/blob/a5e1f3be842e0c4d33b6b87214f4f1daae93a384/src/project/project-resources.ts#L57-L60

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

So it should not be necessary to add to resources. Does it works ?

We don't document those files yet though...

Copy link
Contributor

@mcanouil
Copy link
Contributor Author

Are you sure it works as expected? (I was not aware of this)
The discussion was "reopen" few days ago because the CNAME was erased.

The codepath means the CNAME needs to be at the root of the source code, but does not block Quarto from cleaning up the output directory. In my understanding, it means, the users need to know, they had to place the file next to _quarto.yml and not next to /index.html. This is not obvious.

@cderv
Copy link
Collaborator

cderv commented Apr 29, 2024

output-dir will always be erased for a new rendering. This is, for now, how Quarto works. So, any files that need to be in the output directory must also be in the source directory or created by the rendering. Any files (not just CNAME or others) created in the output directory will be deleted at the next rendering.

resources is indeed a way to have some files copied. But we support some known filenames for websites like the one I shared.
I don't know if this is still working, as I did not test it, but our codebase assumes it should.

However, as I said, this is not fully documented as clearly AFAIK. So I think we should document this instead of just adding an example for CNAME with a method that is not required as we have the detection feature.

We document somewhat

So probably a part in website regarding those files could be added, or a clarification in each feature related paragraph for what is not obvious.

@mcanouil
Copy link
Contributor Author

mcanouil commented May 3, 2024

@cderv
Copy link
Collaborator

cderv commented May 3, 2024

Yep, we could also close this one by documenting correctly all this ! Thanks for linking the issue.

Should we put this as draft and start working on it again ?

@mcanouil
Copy link
Contributor Author

mcanouil commented May 3, 2024

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.

@mcanouil mcanouil marked this pull request as draft May 3, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants