Skip to content

Commit

Permalink
docs: handle empty licen[cs]e field
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Nov 2, 2023
1 parent f6ea4dc commit ed7e62b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/templates/modules.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ code_symbol <- '{{< fa regular file-code >}}'
if ('tools' %in% names(meta)) {
tools_df <- meta$tools %>% yaml_to_df()
for (colname in c('tool_dev_url', 'homepage', 'documentation')) {
for (colname in c('tool_dev_url', 'homepage', 'documentation', 'licence')) {
if (!(colname %in% colnames(tools_df))) {
tools_df[colname] <- NA_character_
}
Expand All @@ -69,7 +69,9 @@ if ('tools' %in% names(meta)) {
TRUE ~ ""),
code = case_when(!is.na(tool_dev_url) ~ glue("[{ code_symbol } Code]({ tool_dev_url })"),
TRUE ~ ""),
links = paste(home, docs, code, glue("`{ licence }`"),
license = case_when(!is.na(licence) ~ glue("`{ licence }`"),
TRUE ~ "")
links = paste(home, docs, code, license,
sep = " &ensp; "),
markdown = glue("{ name }", "{ links }", "{ description }",
.sep = '\n\n')
Expand Down

0 comments on commit ed7e62b

Please sign in to comment.