Skip to content

Commit

Permalink
💄 Fix favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaoz-Topsy committed Mar 7, 2024
1 parent 221189f commit 79228df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .vitepress/config.head.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { HeadConfig } from 'vitepress';

const faviconPath = (suffix: string) => `/assets/favicon/${suffix}`;

const icon = (filename: string, size: string) => ({
rel: 'icon',
type: 'image/png',
sizes: size,
href: faviconPath(filename),
});

export const head: HeadConfig[] = [
['link', { rel: 'icon', type: 'image/x-icon', href: faviconPath('favicon.ico') }],
['link', icon('favicon-16x16.png', '16x16')],
['link', icon('favicon-32x32.png', '32x32')],
['link', icon('favicon-96x96.png', '96x96')],
];
2 changes: 2 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as fs from 'fs';
import { defineConfig } from 'vitepress';
import { head } from './config.head.mts';
import { nav } from './config.navbar.mts';
import { sidebar } from './config.sidebar.mts';

Expand All @@ -8,6 +9,7 @@ export default defineConfig({
description: 'A custom solution for capturing data for the yearly Unification Days event',
srcExclude: ['**/README.md', '**/TODO*.md'],
lang: 'en-GB',
head: head,
themeConfig: {
logo: '/assets/img/logo.png',
nav: nav,
Expand Down

0 comments on commit 79228df

Please sign in to comment.