Skip to content

Commit

Permalink
Add classes to sidebar sections
Browse files Browse the repository at this point in the history
Closes #450
  • Loading branch information
hadley committed Mar 20, 2018
1 parent c95c365 commit c39c7ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 5 additions & 3 deletions R/build-home-index.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,17 @@ data_home_sidebar_links <- function(pkg = ".") {
sidebar_section("Links", links)
}

sidebar_section <- function(heading, bullets) {
sidebar_section <- function(heading, bullets, class = make_slug(heading)) {
if (length(bullets) == 0)
return(character())

paste0(
"<h2>", heading, "</h2>",
"<div class='", class, "'>\n",
"<h2>", heading, "</h2>\n",
"<ul class='list-unstyled'>\n",
paste0("<li>", bullets, "</li>\n", collapse = ""),
"</ul>\n"
"</ul>\n",
"</div>\n"
)
}

Expand Down
12 changes: 10 additions & 2 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c39c7ec

Please sign in to comment.