From d5010e426db0a378ba0ed8e6e6a62eb641411be3 Mon Sep 17 00:00:00 2001 From: Jay Hesselberth Date: Mon, 30 Sep 2024 08:40:38 -0600 Subject: [PATCH] Fix yaml author block parsing Fixes #2788 --- R/build-home-authors.R | 4 ++-- tests/testthat/_snaps/build-home-authors.md | 8 ++++---- tests/testthat/test-build-home-authors.R | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/R/build-home-authors.R b/R/build-home-authors.R index 69a61d80e..8a7100e52 100644 --- a/R/build-home-authors.R +++ b/R/build-home-authors.R @@ -46,8 +46,8 @@ data_authors <- function(pkg = ".", roles = default_roles(), call = caller_env() main = main, inst = inst, needs_page = more_authors || length(comments) > 0 || !is.null(inst), - before = config_pluck_markdown_block(pkg, "template.authors.before", call = call), - after = config_pluck_markdown_block(pkg, "template.authors.after", call = call) + before = config_pluck_markdown_block(pkg, "authors.before", call = call), + after = config_pluck_markdown_block(pkg, "authors.after", call = call) )) } diff --git a/tests/testthat/_snaps/build-home-authors.md b/tests/testthat/_snaps/build-home-authors.md index eae9b6540..17dbde716 100644 --- a/tests/testthat/_snaps/build-home-authors.md +++ b/tests/testthat/_snaps/build-home-authors.md @@ -6,15 +6,15 @@ Error in `data_authors_()`: ! In _pkgdown.yml, authors must be a list, not the number 1. Code - data_authors_(template = list(authors = list(before = 1))) + data_authors_(authors = list(before = 1)) Condition Error in `data_authors_()`: - ! In _pkgdown.yml, template.authors.before must be a string, not the number 1. + ! In _pkgdown.yml, authors.before must be a string, not the number 1. Code - data_authors_(template = list(authors = list(after = 1))) + data_authors_(authors = list(after = 1)) Condition Error in `data_authors_()`: - ! In _pkgdown.yml, template.authors.after must be a string, not the number 1. + ! In _pkgdown.yml, authors.after must be a string, not the number 1. # data_home_sidebar_authors validates yaml inputs diff --git a/tests/testthat/test-build-home-authors.R b/tests/testthat/test-build-home-authors.R index e6245a875..128ff9fce 100644 --- a/tests/testthat/test-build-home-authors.R +++ b/tests/testthat/test-build-home-authors.R @@ -15,8 +15,8 @@ test_that("data_authors validates yaml inputs", { expect_snapshot(error = TRUE, { data_authors_(authors = 1) - data_authors_(template = list(authors = list(before = 1))) - data_authors_(template = list(authors = list(after = 1))) + data_authors_(authors = list(before = 1)) + data_authors_(authors = list(after = 1)) }) })