function fixFontPaths
fixFontPaths(options: FixFontPathsOptions): string

Generates a shell command to fix font paths

Converts relative paths like url("fonts-en/file.woff2") to absolute paths like url("/fonts-en/file.woff2") in CSS files.

Examples

Example 1

const command = fixFontPaths({
  cssFiles: ["fonts.css"],
  fontDirs: ["fonts"],
});
site.script("fixFonts", command);

Parameters

Configuration options

Return Type

string

Shell command string to execute via site.script()

Usage

import { fixFontPaths } from ".";