From e13b3e9c44dfa304b2bff72b6642ae92a7fcd9e2 Mon Sep 17 00:00:00 2001 From: "Zhian N. Kamvar" Date: Wed, 14 Dec 2022 08:07:03 -0800 Subject: [PATCH] add lang element to pkgdown template This is a first step towards addressing #205, but there is still a lot more work that needs to go into it. Because I'm pretty sure the tests will not pass, I'm going to skip the continuous integration for now. [skip ci] --- R/utils-yaml.R | 1 + inst/templates/pkgdown-yaml-template.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/R/utils-yaml.R b/R/utils-yaml.R index 3b94b082a..3d4bd27be 100644 --- a/R/utils-yaml.R +++ b/R/utils-yaml.R @@ -162,6 +162,7 @@ create_pkgdown_yaml <- function(path) { yaml <- whisker::whisker.render(yaml, data = list( # Basic information + lang = if (is.null(usr$lang)) NULL else siQuote(usr$lang), version = siQuote(utils::packageVersion("sandpaper")), config = siQuote(path_config(path)), title = siQuote(usr$title), diff --git a/inst/templates/pkgdown-yaml-template.txt b/inst/templates/pkgdown-yaml-template.txt index dfaaf8bcc..b889f4246 100644 --- a/inst/templates/pkgdown-yaml-template.txt +++ b/inst/templates/pkgdown-yaml-template.txt @@ -3,6 +3,7 @@ # If you want to make changes, please edit {{ config }} # ------------------------------------------------------------------ information title: {{ title }} # needed to set the site title +lang: {{ lang }}{{^ lang }}'en'{{ /lang }} home: title: Home strip_header: true