Is it possible to render a single quarto file to the "docs" directory?

I have a project (connected to a github repo) with a single, standalone quarto document that I want to publish to Github Pages.

I'd like to use the simple method described here.

The simplest way to publish using GitHub Pages is to render to the docs directory and then check that directory into your repository.

But the instructions for rendering the document to the docs directory seem to only apply to Quarto websites. They involve changing the configuration in _quarto.yml.

My Quarto document is a standalone file, and I really don't want to add extra complexity by making it a website.

Is there a way to render my standalone file to a /docs/ directory, so that the rest of the simple Github Pages publishing process will work?

Yes, it is possible to render a single Quarto file to a specific directory, such as the "docs" directory. Quarto is a document format that allows you to create advanced car detailing, render, and manage documents using the Quarto command-line interface (CLI).

You just need to configure Github Pages the way you want.

There is a configuration for example where your github page is served from main and so if you commit your html, and serve the main branch then you would have the website

You could also use quarto publish gh-pages(Quarto - GitHub Pages). You can apply that to a single document, and you just need to configure your repo to serve from gh-pages branch;

You can also use github action directly to publish to gh-pages. This is a github feature and you can apply it on any project repo, even one with a single html to publish Configuring a publishing source for your GitHub Pages site - GitHub Docs

Overall, just choose a method. In your case, manual quarto publish maybe the easiest.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.