samanthacsik / samanthacsik.github.io

my personal website, built using Quarto
https://samanthacsik.github.io/
37 stars 4 forks source link

Steps for adding a blog #2

Closed samanthacsik closed 1 year ago

samanthacsik commented 2 years ago
  1. create subdirectory in your website project called posts -- this is where your blog posts will eventually live
  2. add a _metadata.yml file to your posts directory using touch _metadata.yml in the terminal -- options specified in this file will apply to all documents inside the posts folder. NOTE: this is not required, but can make your life easier if you want certain options to apply to all blog posts that you create. You may want to start with the following options:
# options specified here will apply to all posts in this folder

# freeze computational output
# (see https://quarto.org/docs/projects/code-execution.html#freeze)
freeze: true

# Enable banner style title blocks
title-block-banner: true
  1. add a posts.qmd to root directory -- this is your "listing page" where all your blog post previews will appear
  2. modify the yaml of posts.qmd (just some options included below, not all are necessary, some are set to defaults):
---
title: "posts"
listing:
  contents: posts
  sort: "date desc"
  type: grid
  grid-item-border: true
  grid-item-align: left
  max-description-length: 175
  date-format: medium
  categories: true
---
  1. add your listing page, posts.qmd to your website's navbar in _quarto.yml
  2. to add your first blog post, create a subdirectory inside your posts folder and add an index.qmd file to that subdirectory (e.g. posts/my_first_blog_post/index.qmd)
  3. Some yaml options to consider including for individual post index.qmd files:
---
title: "blog post title"
description: |
  blog post description (appears underneath the title in smaller text) which is included on the listing page
author: "Samantha Csik"
date: 09-24-2021
categories: [distill, R] # self-defined categories
image: preview_image.jpg
---
  1. Important: for a blog post to show up on your rendered website, you need to *Render* the index.qmd file before you build your site using the Render Website** button. You only need to do this the first time you publish your post, unless your specify freeze: true and subsequently make changes to your post.