mt-digital / newpost

Create a new index.qmd file for your Quarto blog

Home Page:https://smach.github.io/newpost/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

newpost

THIS IS A FORK of the nice, simple repo smach/newpost. I (mt-digital) just wanted to make minor customizations.

newpost is a simple, two-function package for Quarto blogs that helps you create a new folder and index.qmd file for a new blog post. It uses the RStudio IDE's API, so you do need to be running RStudio for this to work properly.

WARNING: This will create folders and files on your system!

Installation

This package is not on CRAN, but you can install it with

remotes::install_github("mt-digital/newpost", build_vignettes = TRUE)

Example

Let's say you want to write a new post with the headline "Welcome to my blog!" and it's March 1, 2023. Run

library(newpost)
newpost("Welcome to my blog!")

and the function will create a 2023-03-01_welcome-to-my-blog folder, set the working director to that folder, create an index.qmd file with some basic YAML, and open the file.

The newpost() function has one required argument: the headline for your post. If you run newpost("Welcome to my blog!") on March 8, 2023, it will create a folder 2023-03-08-welcome-to-my-blog in your blog's posts directory, and also create an index.qmd file in that new directory with "Welcome to my blog!" as the YAML title. There are optional arguments for description, author, and categories. Categories should be a single comma-separated string and not a character vector, such as "General, Community".

See the intro vignette for more details.

About

Create a new index.qmd file for your Quarto blog

https://smach.github.io/newpost/

License:Other


Languages

Language:R 100.0%