Skip to content

Commit

Permalink
Closes #2205 add previous website links (#2207)
Browse files Browse the repository at this point in the history
* website links

* Update website-versions.Rmd

* Update website-versions.Rmd

* progress
  • Loading branch information
ddsjoberg authored Nov 1, 2023
1 parent a949c19 commit 88628fc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: admiral
Type: Package
Title: ADaM in R Asset Library
Version: 0.12.2.9001
Version: 0.12.3.9002
Authors@R: c(
person("Ben", "Straub", email = "[email protected]", role = c("aut", "cre")),
person("Stefan", "Bundfuss", role = "aut"),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ were enhanced such that more than one summary variable can be derived, e.g.,
- Removed Deprecation section in Reference tab. Added new Superseded section in
Reference tab. (#2174)

- Added a link to the previous versions of the website to the navigation bar. (#2205)

## Various

- Website now has button/links to Slack channel and GitHub Issues (#2127)
Expand Down
9 changes: 7 additions & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ reference:

navbar:
structure:
left: [getstarted, reference, articles, community, news]
right: [search, slack, newissue, github]
left: [getstarted, reference, articles, community, news, versions]
right: [search, slack, history, newissue, github]
components:
getstarted:
text: Get Started
Expand Down Expand Up @@ -194,6 +194,11 @@ navbar:
href: articles/lab_grading.html
- text: Hy's Law Implementation
href: articles/hys_law.html

history:
icon: fa-history
href: articles/website-versions.html
aria-label: Previous Release Websites
slack:
icon: fa-slack
href: https://app.slack.com/client/T028PB489D3/C02M8KN8269
Expand Down
14 changes: 10 additions & 4 deletions vignettes/articles/website-versions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ all_folders <-
unique()
# subset to all version folders
all_version_folders <- all_folders[grep("^v[0-9]+", x = all_folders)]
all_version_folders <-
all_folders[grep("^v[0-9]+|dev", x = all_folders)] |>
rev()
# more dev first if it appears
if ("dev" %in% all_version_folders) {
all_version_folders <- c("dev", all_version_folders) |> unique()
}
# release dates of prior tags
df_tags <- gert::git_tag_list()
Expand All @@ -46,7 +52,6 @@ df_tags$date <-
) |>
unlist()
df_tags <- df_tags[!is.na(df_tags$date), ]
df_tags
lst_tag_dates <-
paste0(" (", df_tags$date, ")") |>
Expand All @@ -56,9 +61,10 @@ lst_tag_dates <-
# string with all markdown links
str_website_links <-
lapply(
X = all_version_folders |> rev(),
X = all_version_folders,
FUN = function(x) {
paste0("[", x, lst_tag_dates[[x]], "](", paste0(base_url, x), ")")
x_label <- ifelse(x %in% "dev", "Development Site", x)
paste0("[", x_label, lst_tag_dates[[x]], "](", paste0(base_url, x), ")")
}
) |>
unlist() |>
Expand Down

0 comments on commit 88628fc

Please sign in to comment.