function getFaviconPaths
getFaviconPaths(
variant?: FaviconVariant,
baseUrl?: string,
): FaviconPaths

Get the file paths for a favicon variant

Examples

Example 1

// For local development
const paths = getFaviconPaths('darkblue', '/assets/favicons');

// For CDN/GitHub raw URL
const paths = getFaviconPaths('darkblue',
  'https://raw.githubusercontent.com/eSolia/marquis/v0.1.0/assets/favicons'
);

// Use in HTML
const link = `<link rel="icon" href="${paths.favicon32}">`;

Parameters

optional
variant: FaviconVariant = darkblue
  • The color variant to use
optional
baseUrl: string = /assets/favicons
  • Base URL/path where favicons are hosted (no trailing slash)

Return Type

Object containing paths to all favicon files

Usage

import { getFaviconPaths } from ".";