diff --git a/R/create_lesson.R b/R/create_lesson.R index 13da31cb1..5c91ba819 100644 --- a/R/create_lesson.R +++ b/R/create_lesson.R @@ -44,10 +44,15 @@ create_lesson <- function(path, name = fs::path_file(path), rmd = TRUE, rstudio copy_template("setup", fs::path(path, "learners"), "setup.md") copy_template("index", path, "index.md") copy_template("links", path, "links.md") - copy_template("placeholder", fs::path(path, "instructors"), "instructor-notes.md") - copy_template("placeholder", fs::path(path, "profiles"), "learner-profiles.md") - copy_template("placeholder", fs::path(path, "learners"), "reference.md", - values = c(title = "Glossary")) + copy_template("placeholder", fs::path(path, "instructors"), + name = "instructor-notes.md", + values = list(title = "Instructor Notes", heading = NULL)) + copy_template("placeholder", fs::path(path, "profiles"), + name = "learner-profiles.md", + values = list(title = NULL, heading = NULL)) + copy_template("placeholder", fs::path(path, "learners"), + name = "reference.md", + values = c(title = "Reference", heading = "Glossary")) cli::cli_status_update("{cli::symbol$arrow_right} Generating {.file config.yaml} ...") account <- tryCatch(gh::gh_whoami()$login, error = function(e) "carpentries") diff --git a/R/utils-sidebar.R b/R/utils-sidebar.R index f0f63cf3f..311e093a7 100644 --- a/R/utils-sidebar.R +++ b/R/utils-sidebar.R @@ -24,7 +24,6 @@ page_location <- function(i, abs_md, er) { #' @return a list with character vectors of HTML list elements. #' @keywords internal create_resources_dropdown <- function(files, type = "learners") { - files <- files[!grepl("reference[.]R?md$", fs::path_file(files))] if (type == "learners") { files <- files[!grepl("setup[.]R?md$", fs::path_file(files))] } diff --git a/inst/templates/config-template.txt b/inst/templates/config-template.txt index 4bf6ed953..a498314a6 100644 --- a/inst/templates/config-template.txt +++ b/inst/templates/config-template.txt @@ -14,20 +14,20 @@ carpentry: {{ carpentry }} title: {{ title }} # Date the lesson was created (YYYY-MM-DD, this is empty by default) -created: ~ +created: {{ created }}{{ ^created }}~ # FIXME {{ /created }} # Comma-separated list of keywords for the lesson -keywords: {{keywords}}{{^keywords}}software, data, lesson, The Carpentries{{/keywords}} +keywords: {{keywords}}{{^keywords}}software, data, lesson, The Carpentries # FIXME{{/keywords}} # Life cycle stage of the lesson # possible values: pre-alpha, alpha, beta, stable life_cycle: {{ life_cycle }} -# License of the lesson +# License of the lesson materials (recommended CC-BY 4.0) license: {{ license }} # Link to the source repository for this lesson -source: {{ source }}{{ ^source }}https://example.com/template-source{{ /source }} +source: {{ source }}{{ ^source }}https://example.com/FIXME-template-source{{ /source }} # Default branch of your lesson branch: {{ branch }}{{ ^branch }}main{{ /branch }} diff --git a/inst/templates/placeholder-template.txt b/inst/templates/placeholder-template.txt index b1056ed76..2e17c4b4d 100644 --- a/inst/templates/placeholder-template.txt +++ b/inst/templates/placeholder-template.txt @@ -1,9 +1,9 @@ --- -title: FIXME +title: {{title}}{{^title}}FIXME{{/title}} --- -{{#title}} -## {{title}} +{{#heading}} +## {{heading}} -{{/title}} +{{/heading}} This is a placeholder file. Please add content here. diff --git a/tests/testthat/_snaps/build_html.md b/tests/testthat/_snaps/build_html.md index 4de7da2f1..d2771bca2 100644 --- a/tests/testthat/_snaps/build_html.md +++ b/tests/testthat/_snaps/build_html.md @@ -14,6 +14,7 @@
  • Learner Profiles
  • +
  • Reference
  • # [build_home()] instructor index file is index and schedule @@ -54,5 +55,6 @@ Key Points Glossary Learner Profiles + Reference See all in one page diff --git a/tests/testthat/_snaps/build_lesson.md b/tests/testthat/_snaps/build_lesson.md index ec4624e12..5953925cb 100644 --- a/tests/testthat/_snaps/build_lesson.md +++ b/tests/testthat/_snaps/build_lesson.md @@ -24,5 +24,6 @@ Key Points Glossary Learner Profiles + Reference See all in one page