05:00
BAA1028 - Workflow & Data Management
Quarto Websites are a convenient way to publish groups of documents. Documents published as part of a website share navigational elements, rendering options, and visual style.
Website navigation can be provided through a global navbar, a sidebar with links, or a combination of both for sites that have multiple levels of content. You can also enable full text search for websites.
When asked for the name of your website, use your name (e.g. Damien Dupré), and then:
05:00
Creates a new website project from the Terminal. This website project is initiated by a folder called your-github-username.github.io
located on the root of your terminal.
The folder contains only 4 files:
_quarto.yml
is a yaml file, it design the overall style and the navbarindex.qmd
is a quarto file, it corresponds to the homepageabout.qmd
is another quarto file which is displayed when about is clicked on the navbarstyles.css
is for additional style not defined in _quarto.yml
Improve your Website:
This command is used to render the website by converting all the .qmd
files to .html
files stored in a _site
folder.
The website preview will open in a new web browser. As you edit and save index.qmd
(or other files like about.qmd
) the preview is automatically updated.
Unfortunately .ipynb
files cannot be used to build a website.
Thankfully they can be converted to .qmd
format by quarto with the instruction:
.qmd
files are actually very similar to .ipynb
files and are tailored for quarto:
---
signsChunks are delimited by 3 backticks on each end ```
followed by the engine (python
) between curly braces {python}
hello.qmd
created in the root of the your-github-username.github.io
folder10:00
There are three ways to publish Quarto websites and documents to GitHub Pages:
Render sites on your local machine to the docs directory, check the rendered site into GitHub, and then configure your GitHub repo to publish from the docs directory.
Use the quarto publish command to publish content rendered on your local machine.
Use a GitHub Action to automatically render your files (a single Quarto document or a Quarto project) and publish the resulting content whenever you push a source code change to your repository.
In the _quarto.yml
file, simply change the output directory folder to a folder named docs
as follow:
Then preview or render the website:
Your website default folder should look like that
Note: the old folder _site
will not be used any more and is now useless.
Add a .nojekyll
file to the root of your repository that tells GitHub Pages not to do additional processing of your published site using Jekyll (the GitHub default site generation tool).
You can create it from the terminal when the website folder is the current directory:
When GitHub suggests ways how to upload files, it gives instructions to create a new repository on the command line with git.
For example:
Terminal
You should see all your files uploaded in your GitHub repository
docs
in the _quarto.yml
file:Then, preview or render the website
In the Source Control
panel, click Initialize Repository, add all files by clicking on +, add a mandatory message and click ✔️ Commit. Finally, click Publish Branch
In GitHub, click Settings -> Pages choose:
main
branch/docs
folder10:00
Thanks for your attention and don’t hesitate to ask if you have any questions!
@damien_dupre
@damien-dupre
https://damien-dupre.github.io
damien.dupre@dcu.ie