Skip to content

Commit bf9d041

Browse files
authored
Merge pull request #391 from ThinkR-open/dev
version 0.2.1
2 parents 893d311 + aaf72d5 commit bf9d041

File tree

4 files changed

+30
-33
lines changed

4 files changed

+30
-33
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: golem
22
Title: A Framework for Robust Shiny Applications
3-
Version: 0.2.0
3+
Version: 0.2.1
44
Authors@R:
55
c(person(given = "Vincent",
66
family = "Guyader",

NEWS.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
> Notes: the # between parenthesis referes to the related issue on GitHub, and the @ refers to an external contributor solving this issue.
22
3+
# golem 0.2.9000+
4+
5+
## bug fix
6+
7+
+ fixed issue with favicon when package is built (#387)
8+
39
# golem 0.1.9000+
410

511
## New functions

R/use_favicon.R

+19-30
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ use_favicon <- function(
9595
)
9696
}
9797

98-
cat_line(
99-
"Favicon is automatically linked in app_ui via `golem_add_external_resources()`"
100-
)
101-
cat_red_bullet(
102-
sprintf(
103-
"No file found at %s",
104-
path
98+
if (ext == "png"){
99+
cat_red_bullet(
100+
"You choose a png favicon, please add `ext = 'png'` to the `favicon()` function in golem_add_external_resources()."
105101
)
106-
)
107-
102+
} else {
103+
cat_line(
104+
"Favicon is automatically linked in app_ui via `golem_add_external_resources()`"
105+
)
106+
}
107+
108108
}
109109

110110
#' @rdname favicon
@@ -138,34 +138,23 @@ remove_favicon <- function(
138138
#' @param ico path to favicon file
139139
#' @param rel rel
140140
#' @param resources_path prefix of the resource path of the app
141-
#' @inheritParams add_modules
141+
#' @param ext the extension of the favicon
142142
#'
143143
#' @export
144144
#' @importFrom htmltools tags
145145
favicon <- function(
146-
ico,
146+
ico = "favicon",
147147
rel="shortcut icon",
148148
resources_path = "www",
149-
pkg = get_golem_wd()
149+
ext = "ico"
150150
){
151-
if (missing(ico)){
152-
ici <- list.files(
153-
pattern = "favicon",
154-
fs::path(
155-
pkg,
156-
"inst/app/www"
157-
)
158-
)
159-
attempt::stop_if(
160-
length(ici),
161-
~ .x > 2,
162-
"You have 2 favicons inside your app/www folder, please remove one."
163-
)
164-
ico <- fs::path(
165-
resources_path,
166-
ici
167-
)
168-
}
151+
152+
ico <- fs::path(
153+
resources_path,
154+
ico,
155+
ext = ext
156+
)
157+
169158
tags$head(
170159
tags$link(
171160
rel = rel,

man/favicon.Rd

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)