
Download logo and build favicons for pkgdown or Quarto sites
Source:R/setup-favicon.R
setup_favicon.RdAutomates the tedious process of setting up package branding assets. Use this when initializing a new R package or Quarto site to ensure consistent Artalytics branding without manual file downloads or favicon generation.
The function auto-detects project type based on config files, downloads the logo, and generates a complete favicon set via the realfavicongenerator.net API.
Usage
setup_favicon(
pkg = ".",
url = "https://cdn.artalytics.art/assets/logo/logo-core-128w-v48b04112.png",
overwrite = FALSE,
quiet = FALSE
)Arguments
- pkg
Character. Path to project root directory containing
_pkgdown.ymlor_quarto.yml. Defaults to current directory ("."). The directory must exist and contain exactly one of the supported config files. Use absolute paths when calling from scripts outside the project directory.- url
Character. URL of the logo image to download (PNG or SVG format). Defaults to the Artalytics CDN logo. For custom branding, provide a direct URL to a square image (minimum 128x128px recommended for favicon quality). The URL must be publicly accessible.
- overwrite
Logical. Whether to re-download the logo and regenerate all favicons even if they already exist. Default
FALSEskips existing files. Set toTRUEwhen updating branding or fixing corrupted assets.- quiet
Logical. Whether to suppress progress messages during download and favicon generation. Default
FALSEshows status messages. Set toTRUEfor non-interactive scripts or CI pipelines.
Value
Character (invisible). The absolute path to the downloaded logo file. Useful for verification or subsequent operations on the logo.
Details
Project type detection:
pkgdown:
_pkgdown.ymlpresent → logo toman/figures/logo.png, favicons topkgdown/favicon/Quarto:
_quarto.ymlpresent → logo towww/assets/logo/logo.png, favicons towww/assets/favicon/
Requirements:
Package {openssl} must be installed for favicon generation
Internet connection required for logo download and API call
Project must have either
_pkgdown.ymlor_quarto.yml(not both)
See also
Other pkg-dev:
screenshot_app()