A public website showcasing resources from the Data Management and Statistical Core at the Michigan Alzheimer's Disease Center.
We decided to build our public-facing website using Quarto because it combines the simplicity of Markdown with the power of a professional publishing system. Quarto's flexibility allows us to create dynamic, reproducible content while integrating seamlessly with modern development workflows, such as GitHub Pages for hosting. This platform makes it easy to maintain and extend our site, ensuring our content stays organized and accessible.
Whether you're exploring Quarto for your own projects or contributing to this website, you'll find the steps outlined here helpful.
Ensure you have completed the following steps:
- Download Git
- Create a GitHub account (sign up here) if you do not already have one
Download and install Visual Studio Code: VS Code Download Page
Follow the instructions to install Quarto on your system: Quarto Installation Guide
Add the Quarto extension to VS Code from the Marketplace: Quarto Extension
If VS Code is open during installation, quit and relaunch it to ensure the extension loads properly.
- Open VS Code.
- Press
Ctrl+Shift+P
(orCmd+Shift+P
on Mac) to open the Command Palette. - Type and select
Quarto: Create Project
. - Choose
Website
as the project type. - Specify a folder location and project name, then click
Create
. - Edit the configuration file (
_quarto.yml
) and content files to customize the website. - Preview the website locally:
- Right-click on the
index.qmd
file and selectQuarto: Preview
.
- Right-click on the
Follow the publishing instructions to deploy the website: GitHub Pages Deployment Guide
- In the configuration file (
_quarto.yml
), change the project configuration to usedocs
as theoutput-dir
:
project:
type: website
output-dir: docs
- Add an empty file named
.nojekyll
to the root of the project repository to prohibit GitHub pages from using the default site generation tool, Jekyll. - Render the site locally and push the changes to GitHub by running the following commands in the terminal or by using the Quarto extension:
quarto render
git add docs
git commit -m "Publish site to docs/"
git push
- Enable GitHub Pages for the repository:
- Go to your respository's
Settings
. - Under
Pages
in the left-hand sidebar, select thedocs
folder on the main branch as the source.
- Go to your respository's
- For all future commits and pushes to main, these changes will trigger a deployment of your website.
- Go to the main repository on GitHub: dmsc-madc.
- Click the
Fork
button in the upper-right corner to create a copy of the repository in your own GitHub account.
- Open the Source Control view (Ctrl+Shift+G).
- Click
Clone Repository
and paste the URL of your forked repository (e.g.,https://github.com/your-username/repo-name.git
). - Choose a folder location for the repository.
- Open a terminal window in VS Code (Ctrl+
or
Cmd+` on Mac). - Run the following command:
git clone https://github.com/your-username/repo-name.git
- Navigate into the cloned repository:
cd repo-name
- Open the Source Control view.
- Click the
...
menu in the top right and selectBranch > Create Branch
. - Enter a name for your branch (e.g.,
your-feature-branch
).
- Run the following command to create a new branch:
git checkout -b your-feature-branch
- Open the project folder in VS Code.
- Edit existing content or add new pages as appropriate.
- Preview your Quarto documents locally:
- Right-click a
.qmd
file and selectQuarto: Preview
.
- Right-click a
- Open the Source Control view.
- Stage your changes by clicking the
+
next to the files you modified. - Enter a commit message and click the checkmark to commit.
- Stage your changes:
git add .
- Commit your changes:
git commit -m "Your commit message"
- Open the Source Control view.
- Click the
...
menu and selectPush
.
- Push your branch to GitHub:
git push origin your-feature-branch
- Go to your forked repository on GitHub
- Click the link at the top of your repository showing how many commits ahead your fork is compared to the original repository.
- Add a descriptive title and details about your changes.
- Submit the pull request for review.
- Monitor your pull request for any comments or requested changes from maintainers.
- Address feedback by committing new changes to the same branch and pushing them.
If you're inspired to create your own website or documentation project using Quarto, start by following the steps outlined above to set up Quarto locally and in VS Code. Refer to the official Quarto Website Documentation for further details.
Quarto’s versatility makes it a great choice for building websites, technical documents, and presentations. Experiment with its features, and don’t hesitate to share your experience!
- Learn how to sync your fork to keep it up to date with the original repository.
- Review the GitHub Pages Deployment Guide for additional details.
- Brush up on Markdown Basics to format your contributions effectively.