Skip to content

Commit e5c146e

Browse files
committed
1 parent 6615322 commit e5c146e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

R/build-home-authors.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ build_citation_authors <- function(pkg = ".") {
1010
authors <- data_authors(pkg)
1111
data <- list(
1212
pagetitle = tr_("Authors and Citation"),
13+
citation_header = data_citations_header(pkg),
1314
citations = data_citations(pkg),
1415
authors = unname(authors$all),
1516
inst = authors$inst,
@@ -245,6 +246,17 @@ data_home_sidebar_citation <- function(pkg = ".") {
245246
)
246247
}
247248

249+
data_citations_header <- function(pkg = ".") {
250+
pkg <- as_pkgdown(pkg)
251+
252+
print("heoo")
253+
if (has_citation(pkg$src_path)) {
254+
provided_citation <- read_citation(pkg$src_path)
255+
return(attr(provided_citation, "mheader"))
256+
}
257+
NULL
258+
}
259+
248260
data_citations <- function(pkg = ".") {
249261
pkg <- as_pkgdown(pkg)
250262

inst/BS3/templates/content-citation-authors.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ <h1 id="citation">{{#translate}}{{citation}}{{/translate}}</h1>
2323
</div>
2424
</div>
2525

26+
{{#citation_header}}
2627

2728
{{#citations}}
2829
{{{html}}}

0 commit comments

Comments
 (0)