Skip to content

Commit

Permalink
Change intro post path (closes #10)
Browse files Browse the repository at this point in the history
  • Loading branch information
EllaKaye committed Jan 2, 2024
1 parent edc88bf commit 66e3211
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions R/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ aoc_delete_day <- function(day, year = NULL) {
#' posts which are in the subdirectory `./YYYY/day` (which echoes the URL
#' structure of the Advent of Code website). Note that the website will fail to
#' render if there are no posts under the `day` directory. To avoid that
#' problem, by default an introduction post `YYYY-intro` is created, assuming
#' problem, by default an introduction post `introduction` is created, assuming
#' that the directory `./_templates/YYYY-intro` exists (which it does in the
#' website template
#' <https://github.com/EllaKaye/advent-of-code-website-template>. If you don't
#' <https://github.com/EllaKaye/advent-of-code-website-template>.) If you don't
#' want an introduction post, set `intro = FALSE`. An introduction post can also
#' be created separately with [aoc_new_intro()] or deleted with
#' [aoc_delete_intro()]. Without an introduction post, note that you will need
Expand Down Expand Up @@ -319,7 +319,7 @@ aoc_new_year <- function(year = NULL, intro = TRUE) {
intro_template_path <- here::here("_templates", "YYYY-intro")

if (intro && dir.exists(intro_template_path)) {
intro_post_path <- here::here(year, "day", paste0(year, "-introduction"))
intro_post_path <- here::here(year, "day", "introduction")
dir.create(intro_post_path, recursive = TRUE)
file.copy(list.files(intro_template_path, full.names = TRUE),
intro_post_path, recursive = TRUE)
Expand All @@ -346,7 +346,7 @@ aoc_new_year <- function(year = NULL, intro = TRUE) {

#' Create an introduction post
#'
#' Create an intro post with relative path `./YYYY/day/YYYY-intro` (where `YYYY`
#' Create an intro post with relative path `./YYYY/day/introduction` (where `YYYY`
#' is the value of `year`) by copying the template at `./_templates/YYYY-intro`
#' and substituting `YYYY` for the value of `year`, both in the new file name and in the
#' file itself.
Expand Down Expand Up @@ -377,7 +377,7 @@ aoc_new_intro <- function(year = NULL) {
"!" = "See {.fun aochelpers::aoc_new_year} for more information."))
}

intro_post_path <- here::here(year, "day", paste0(year, "-introduction"))
intro_post_path <- here::here(year, "day", "introduction")

if (!dir.exists(intro_post_path)) {
dir.create(intro_post_path)
Expand Down
2 changes: 1 addition & 1 deletion man/aoc_new_intro.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/aoc_new_year.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 66e3211

Please sign in to comment.