Skip to content

Commit

Permalink
Merge pull request #391 from ThinkR-open/dev
Browse files Browse the repository at this point in the history
version 0.2.1
  • Loading branch information
ColinFay authored Mar 5, 2020
2 parents 893d311 + aaf72d5 commit bf9d041
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 33 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: golem
Title: A Framework for Robust Shiny Applications
Version: 0.2.0
Version: 0.2.1
Authors@R:
c(person(given = "Vincent",
family = "Guyader",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
> Notes: the # between parenthesis referes to the related issue on GitHub, and the @ refers to an external contributor solving this issue.
# golem 0.2.9000+

## bug fix

+ fixed issue with favicon when package is built (#387)

# golem 0.1.9000+

## New functions
Expand Down
49 changes: 19 additions & 30 deletions R/use_favicon.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ use_favicon <- function(
)
}

cat_line(
"Favicon is automatically linked in app_ui via `golem_add_external_resources()`"
)
cat_red_bullet(
sprintf(
"No file found at %s",
path
if (ext == "png"){
cat_red_bullet(
"You choose a png favicon, please add `ext = 'png'` to the `favicon()` function in golem_add_external_resources()."
)
)

} else {
cat_line(
"Favicon is automatically linked in app_ui via `golem_add_external_resources()`"
)
}

}

#' @rdname favicon
Expand Down Expand Up @@ -138,34 +138,23 @@ remove_favicon <- function(
#' @param ico path to favicon file
#' @param rel rel
#' @param resources_path prefix of the resource path of the app
#' @inheritParams add_modules
#' @param ext the extension of the favicon
#'
#' @export
#' @importFrom htmltools tags
favicon <- function(
ico,
ico = "favicon",
rel="shortcut icon",
resources_path = "www",
pkg = get_golem_wd()
ext = "ico"
){
if (missing(ico)){
ici <- list.files(
pattern = "favicon",
fs::path(
pkg,
"inst/app/www"
)
)
attempt::stop_if(
length(ici),
~ .x > 2,
"You have 2 favicons inside your app/www folder, please remove one."
)
ico <- fs::path(
resources_path,
ici
)
}

ico <- fs::path(
resources_path,
ico,
ext = ext
)

tags$head(
tags$link(
rel = rel,
Expand Down
6 changes: 4 additions & 2 deletions man/favicon.Rd

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

0 comments on commit bf9d041

Please sign in to comment.