From fd94967e39220996680c5524f142334c529e16ca Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Tue, 13 Jun 2023 12:39:40 +0200 Subject: [PATCH] refactor: hide link for manifest in development --- src/layouts/BaseLayout.astro | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 3653f0b..6dea900 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -3,6 +3,7 @@ import '../styles/global.css'; import { Sprite } from 'astro-icon'; import { SEO } from 'astro-seo'; import { site } from '../data/site'; +import { isProduction } from '../utils'; import ThemeProvider from '../components/ThemeProvider.astro'; import PageHeader from '../components/PageHeader.astro'; @@ -42,6 +43,11 @@ const schema = JSON.stringify({ name: site.author, url: site.url, }); + +const webManifest = isProduction && { + rel: 'manifest', + href: '/manifest.webmanifest', +}; --- @@ -91,10 +97,7 @@ const schema = JSON.stringify({ rel: 'apple-touch-icon', href: '/assets/images/branding/favicons/apple-touch-icon.png', }, - { - rel: 'manifest', - href: '/manifest.webmanifest', - }, + { ...webManifest }, { as: 'font', crossorigin: '', @@ -133,12 +136,6 @@ const schema = JSON.stringify({ title: 'Stefan Imhoff (AI Art)', href: site.url + '/rss-ai-art.xml', }, - { - rel: 'alternate', - type: 'application/rss+xml', - title: 'Stefan Imhoff (Projects)', - href: site.url + '/rss-projects.xml', - }, ], meta: [ { name: 'viewport', content: 'width=device-width, initial-scale=1' },