function getFaviconHtml
getFaviconHtml(
variant?: FaviconVariant,
baseUrl?: string,
): string

Generate HTML link tags for favicons

Returns a complete set of link tags for the <head> section, including browser icons, Apple Touch Icon, and web manifest.

Examples

Example 1

// In a Vento/HTML template
const html = `
<!DOCTYPE html>
<html>
<head>
  ${getFaviconHtml('darkblue', '/assets/favicons')}
  <title>My App</title>
</head>
...
`;

// For GitHub raw URLs (versioned)
const baseUrl = 'https://raw.githubusercontent.com/eSolia/marquis/v0.1.0/assets/favicons';
const html = getFaviconHtml('darkblue', baseUrl);

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

string

HTML string with all necessary link tags

Usage

import { getFaviconHtml } from ".";