feat: Upgrade template based on projects made with it
Some checks failed
Build, check & Test / run (push) Failing after 42s
Some checks failed
Build, check & Test / run (push) Failing after 42s
Signed-off-by: Florian Bouillon <f.bouillon@aptatio.com>
This commit is contained in:
24
src/components/layouts/Favicon/Favicon.astro
Normal file
24
src/components/layouts/Favicon/Favicon.astro
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
import { getImage } from 'astro:assets'
|
||||
|
||||
export interface Props {
|
||||
svg: ImageMetadata
|
||||
png: ImageMetadata
|
||||
icoPath?: string
|
||||
}
|
||||
|
||||
if (Astro.props.icoPath !== '/favicon.ico') {
|
||||
console.warn('It is recommanded that the ICO file should be located at /favicon.ico')
|
||||
|
||||
}
|
||||
|
||||
const appleTouch = await getImage({src: Astro.props.png, width: 180, height: 180})
|
||||
---
|
||||
|
||||
<>
|
||||
<link rel="icon" href={Astro.props.icoPath ?? "/favicon.ico"} sizes="any">
|
||||
<link rel="icon" href={Astro.props.svg.src} type="image/svg+xml">
|
||||
<link rel="apple-touch-icon" href={appleTouch.src} />
|
||||
<!-- Currently not integrated until I find a way to. -->
|
||||
<!-- <link rel="manifest" href="/site.webmanifest" /> -->
|
||||
</>
|
Reference in New Issue
Block a user