Getting Started with Quarto website
This post explains how to setup a website quarto, customizing it and adding new content to it.
Setting Up: Create a new repository from the template
The first step is to go to quarto-website-template repository.
- Go to the repository page and click on the Use this template button
- Select the Include all branches checkbox
- Select a name for your repository
- Write a description for your repository
- And click on Create Repository button
After this step, you’ll have your own repository with a copy of the template repository.
The website will be automatically published whenever you push any changes to the repository.
The website will be live at URL https://<your-github-username>.github.io/<repo-name>
.
Clone the Repository
Clone the repository to your computer so that you can make changes to it.
If you wish you can skip this step and make changes directly from github.com web interface.
Customize site title
Edit the _quarto.yml
file and update the title
field in the website
section.
Commit your changes and push them. The website will be live with the new changes in a minute or two.
Create new pages
Add a new file hello.qmd
(or whatever name that you would like to use). Add the require content.
hello.qmd
# Hello
Hello, world!
If you wish to include that page in the top navigation, add that to navbar.
project:
type: website
website:
title: "Sample Quarto Website"
navbar:
left:
- href: index.qmd
text: Home
- hello.qmd
- about.qmd
Commit & push you changes and wait for a minute to see your changes.
Adding blog posts
The blog posts are in /posts/
directory. There is one directory for every post and the content of the post is in a file index.qmd
in the post directory. A directory is used for a post instead of a single qmd file so that all the supplimentary files like images etc. could be grouped along with the post.
The easiest way to add a new post is to duplicate one of the posts (the while directory for a post), rename it to the name that you want and modify the content.