From 85e388bf6e1d26b387b5304bc98ad59ba61d6796 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 5 Mar 2020 14:21:04 +0100 Subject: [PATCH 1/5] start 0.2.0.9000 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 89ee793f..3197b4a0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: golem Title: A Framework for Robust Shiny Applications -Version: 0.2.0 +Version: 0.2.0.9000 Authors@R: c(person(given = "Vincent", family = "Guyader", From 77cef3319cbee6613d456489827b331c0dcdfde9 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 5 Mar 2020 14:22:25 +0100 Subject: [PATCH 2/5] close #388 --- R/use_favicon.R | 6 ------ 1 file changed, 6 deletions(-) diff --git a/R/use_favicon.R b/R/use_favicon.R index 68d56a5e..bb16a55f 100644 --- a/R/use_favicon.R +++ b/R/use_favicon.R @@ -98,12 +98,6 @@ 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 - ) - ) } From a29f2b438504424aa4b61e1f167f80ceba875a0f Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 5 Mar 2020 14:38:04 +0100 Subject: [PATCH 3/5] should solve #387 --- R/use_favicon.R | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/R/use_favicon.R b/R/use_favicon.R index bb16a55f..03714fc4 100644 --- a/R/use_favicon.R +++ b/R/use_favicon.R @@ -95,10 +95,16 @@ use_favicon <- function( ) } - cat_line( - "Favicon is automatically linked in app_ui via `golem_add_external_resources()`" - ) - + 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 @@ -132,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, From d9d6077164f18e792f5fb7aba760776f79b409e6 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 5 Mar 2020 17:35:27 +0100 Subject: [PATCH 4/5] golem 0.2.1 --- DESCRIPTION | 2 +- NEWS.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3197b4a0..6b99378f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: golem Title: A Framework for Robust Shiny Applications -Version: 0.2.0.9000 +Version: 0.2.1 Authors@R: c(person(given = "Vincent", family = "Guyader", diff --git a/NEWS.md b/NEWS.md index b7b868d1..669fc352 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 From de3e5e3ebae2e86a57d6328e0aa1bd5cb40ad78c Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 5 Mar 2020 17:35:27 +0100 Subject: [PATCH 5/5] golem 0.2.1 --- DESCRIPTION | 2 +- NEWS.md | 6 ++++++ man/favicon.Rd | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3197b4a0..6b99378f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: golem Title: A Framework for Robust Shiny Applications -Version: 0.2.0.9000 +Version: 0.2.1 Authors@R: c(person(given = "Vincent", family = "Guyader", diff --git a/NEWS.md b/NEWS.md index b7b868d1..669fc352 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/man/favicon.Rd b/man/favicon.Rd index 70b8167c..5c44588b 100644 --- a/man/favicon.Rd +++ b/man/favicon.Rd @@ -10,8 +10,8 @@ use_favicon(path, pkg = get_golem_wd(), method = "curl") remove_favicon(path = "inst/app/www/favicon.ico") -favicon(ico, rel = "shortcut icon", resources_path = "www", - pkg = get_golem_wd()) +favicon(ico = "favicon", rel = "shortcut icon", + resources_path = "www", ext = "ico") } \arguments{ \item{path}{Path to your favicon file (.ico or .png)} @@ -25,6 +25,8 @@ favicon(ico, rel = "shortcut icon", resources_path = "www", \item{rel}{rel} \item{resources_path}{prefix of the resource path of the app} + +\item{ext}{the extension of the favicon} } \description{ This function adds the favicon from \code{ico} to your shiny app.