Skip to content

Commit

Permalink
Add CDN location
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Jul 31, 2020
1 parent 4536941 commit 73d56a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/html_dependency.R
Expand Up @@ -4,7 +4,10 @@ html_dependency_applause <- function() {
name = "applause-button",
version = "3.3.2",
package = "applause",
src = "applause-button",
src = c(
file = "applause-button",
href = "https://unpkg.com/applause-button@3.3.2/dist"
),
script = "applause-button.js",
stylesheet = "applause-button.css",
all_files = FALSE
Expand Down
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -125,3 +125,13 @@ html_dependency_applause <- function() {
- The `stylesheet` to be loaded is `applause-button.css`

- And just for safety, we set `all_files = FALSE` so that other files in this folder are included when the dependency is used.

The Applause button distribution files are also available via the unpkg CDN, so I updated `src` to include the URL to the directory containing the files. To specify both the local and remote locations of the distribution files, `src` in `htmlDependency()` accepts a named character vector, where the `file` item corresponds to the local path and the `href` item corresponds to the remote URL.

```r
src = c(
file = "applause-button",
href = "https://unpkg.com/applause-button@3.3.2/dist"
)
```

0 comments on commit 73d56a5

Please sign in to comment.