From 82d310403c4bb09bc2f0a204b6374934a10cf348 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Sat, 29 Jan 2022 23:38:13 +0100
Subject: refactor(config): move config from config dir to utils

---
 src/components/Layouts/Layout.tsx | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

(limited to 'src/components/Layouts/Layout.tsx')

diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx
index b479ef3..d074b68 100644
--- a/src/components/Layouts/Layout.tsx
+++ b/src/components/Layouts/Layout.tsx
@@ -2,7 +2,7 @@ import Footer from '@components/Footer/Footer';
 import Header from '@components/Header/Header';
 import Main from '@components/Main/Main';
 import Breadcrumb from '@components/Breadcrumb/Breadcrumb';
-import { config } from '@config/website';
+import { settings } from '@utils/config';
 import Head from 'next/head';
 import { useRouter } from 'next/router';
 import { ReactElement, ReactNode, useEffect, useRef } from 'react';
@@ -26,19 +26,19 @@ const Layout = ({
 
   const schemaJsonLd: WithContext<WebSite> = {
     '@context': 'https://schema.org',
-    '@id': `${config.url}`,
+    '@id': `${settings.url}`,
     '@type': 'WebSite',
-    name: config.name,
-    description: config.baseline,
-    url: config.url,
-    author: { '@id': `${config.url}/#branding` },
-    copyrightYear: Number(config.copyright.startYear),
-    creator: { '@id': `${config.url}/#branding` },
-    editor: { '@id': `${config.url}/#branding` },
-    inLanguage: config.locales.defaultLocale,
+    name: settings.name,
+    description: settings.baseline,
+    url: settings.url,
+    author: { '@id': `${settings.url}/#branding` },
+    copyrightYear: Number(settings.copyright.startYear),
+    creator: { '@id': `${settings.url}/#branding` },
+    editor: { '@id': `${settings.url}/#branding` },
+    inLanguage: settings.locales.defaultLocale,
     potentialAction: {
       '@type': 'SearchAction',
-      target: `${config.url}/recherche?s={query}`,
+      target: `${settings.url}/recherche?s={query}`,
       query: 'required',
     },
   };
@@ -46,14 +46,14 @@ const Layout = ({
   return (
     <>
       <Head>
-        <meta property="og:site_name" content={config.name} />
+        <meta property="og:site_name" content={settings.name} />
         <meta
           property="og:locale"
-          content={`${config.locales.defaultLocale}_${config.locales.defaultCountry}`}
+          content={`${settings.locales.defaultLocale}_${settings.locales.defaultCountry}`}
         />
         <meta property="twitter:card" content="summary" />
-        <meta property="twitter:site" content={config.twitterId} />
-        <meta property="twitter:creator" content={config.twitterId} />
+        <meta property="twitter:site" content={settings.twitterId} />
+        <meta property="twitter:creator" content={settings.twitterId} />
         <meta
           name="theme-color"
           content="#14578a"
@@ -68,19 +68,19 @@ const Layout = ({
           rel="alternate"
           href="/feed.xml"
           type="application/rss+xml"
-          title={`${config.name}'s RSS feed`}
+          title={`${settings.name}'s RSS feed`}
         />
         <link
           rel="alternate"
           href="/atom.xml"
           type="application/atom+xml"
-          title={`${config.name}'s Atom feed`}
+          title={`${settings.name}'s Atom feed`}
         />
         <link
           rel="alternate"
           href="/feed.json"
           type="application/feed+json"
-          title={`${config.name}'s Json feed`}
+          title={`${settings.name}'s Json feed`}
         />
         <link rel="icon" href="/favicon.ico" sizes="any" />
         <link rel="icon" href="/icon.svg" type="image/svg+xml" />
-- 
cgit v1.2.3

