diff --git a/NEWS.md b/NEWS.md
index 6d39894a4..8e4b773e7 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,6 @@
# pkgdown (development version)
+* `build_home()` now includes the contents of `inst/AUTHORS` on the authors page (#2506).
* If you put a dropdown menu (e.g. articles) on the right hand side of the navbar, it will now be right aligned. This makes longer titles more likely to stay on the page (#2421).
* The title for the "Reference" page is now "Package index" since this page might contain more than just function details (#2181).
* `build_redirects()` now automatically adds redirects for topic
diff --git a/R/build-home-authors.R b/R/build-home-authors.R
index 87fef29a7..8405573c1 100644
--- a/R/build-home-authors.R
+++ b/R/build-home-authors.R
@@ -2,6 +2,13 @@ data_authors <- function(pkg = ".", roles = default_roles()) {
pkg <- as_pkgdown(pkg)
author_info <- pkg$meta$authors %||% list()
+ inst_path <- path(pkg$src_path, "inst", "AUTHORS")
+ if (file_exists(inst_path)) {
+ inst <- read_lines(inst_path)
+ } else {
+ inst <- NULL
+ }
+
all <- pkg %>%
pkg_authors() %>%
purrr::map(author_list, author_info, pkg = pkg)
@@ -22,7 +29,8 @@ data_authors <- function(pkg = ".", roles = default_roles()) {
print_yaml(list(
all = all,
main = main,
- needs_page = more_authors || comments
+ inst = inst,
+ needs_page = more_authors || comments || !is.null(inst)
))
}
@@ -72,18 +80,6 @@ data_home_sidebar_authors <- function(pkg = ".") {
sidebar_section(tr_("Developers"), bullets)
}
-data_authors_page <- function(pkg) {
- data <- list(
- pagetitle = tr_("Authors"),
- authors = data_authors(pkg)$all
- )
-
- data$before <- markdown_text_block(pkg$meta$authors$before)
- data$after <- markdown_text_block(pkg$meta$authors$after)
-
- return(data)
-}
-
author_name <- function(x, authors, pkg) {
name <- format_author_name(x$given, x$family)
diff --git a/R/build-home-citation.R b/R/build-home-citation.R
index e2200bf97..9c35a8ede 100644
--- a/R/build-home-citation.R
+++ b/R/build-home-citation.R
@@ -89,11 +89,12 @@ build_citation_authors <- function(pkg = ".") {
repo_source(pkg, "DESCRIPTION")
}
+ authors <- data_authors(pkg)
data <- list(
pagetitle = tr_("Authors and Citation"),
- citationtitle = tr_("Citation"),
citations = data_citations(pkg),
- authors = unname(data_authors(pkg)$all),
+ authors = unname(authors$all),
+ inst = authors$inst,
source = source
)
diff --git a/R/render.R b/R/render.R
index 00c32b6de..9ec9c95e4 100644
--- a/R/render.R
+++ b/R/render.R
@@ -95,7 +95,8 @@ data_template <- function(pkg = ".", depth = 0L) {
authors = tr_("Authors"),
version = tr_("Version"),
examples = tr_("Examples"),
- citation = tr_("Citation")
+ citation = tr_("Citation"),
+ author_details = tr_("Additional details")
)
# Components that mostly end up in the
diff --git a/inst/BS3/templates/content-citation-authors.html b/inst/BS3/templates/content-citation-authors.html
index d71945a8b..5a40700e1 100644
--- a/inst/BS3/templates/content-citation-authors.html
+++ b/inst/BS3/templates/content-citation-authors.html
@@ -18,7 +18,7 @@ {{pagetitle}}
-
{{citationtitle}}
+ {{#translate}}{{citation}}{{/translate}}
{{#source}}{{{.}}}{{/source}}
diff --git a/inst/BS5/templates/content-citation-authors.html b/inst/BS5/templates/content-citation-authors.html
index 97184c64e..805d86924 100644
--- a/inst/BS5/templates/content-citation-authors.html
+++ b/inst/BS5/templates/content-citation-authors.html
@@ -5,7 +5,7 @@
{{{pagetitle}}}
-
+
{{#translate}}{{authors}}{{/translate}}
{{{before}}}
@@ -19,7 +19,7 @@ {{#translate}}{{authors}}{{/translate}}
{{{after}}}
-
+
{{#translate}}{{citation}}{{/translate}}
{{#source}}{{{.}}}{{/source}}
@@ -28,6 +28,13 @@
{{#translate}}{{citation}}{{/translate}}
{{{bibtex}}}
{{/citations}}
+
+ {{#inst}}
+
+
{{#translate}}{{author_details}}{{/translate}}
+
{{.}}
+
+ {{/inst}}