diff options
Diffstat (limited to 'src/components/Layouts/Layout.tsx')
| -rw-r--r-- | src/components/Layouts/Layout.tsx | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx index eb725d2..d529efe 100644 --- a/src/components/Layouts/Layout.tsx +++ b/src/components/Layouts/Layout.tsx @@ -7,7 +7,7 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import { ReactElement, ReactNode, useEffect, useRef } from 'react'; import { useIntl } from 'react-intl'; -import { WebSite, WithContext } from 'schema-dts'; +import { SearchAction, WebSite, WithContext } from 'schema-dts'; import styles from './Layout.module.scss'; const Layout = ({ @@ -40,11 +40,19 @@ const Layout = ({ creator: { '@id': `${settings.url}/#branding` }, editor: { '@id': `${settings.url}/#branding` }, inLanguage: settings.locales.defaultLocale, - potentialAction: { - '@type': 'SearchAction', - target: `${settings.url}/recherche?s={query}`, - query: 'required', - }, + potentialAction: { '@id': `${settings.url}/#search` }, + }; + + type QueryAction = SearchAction & { + 'query-input': string; + }; + + const searchActionSchema: QueryAction = { + '@type': 'SearchAction', + '@id': `${settings.url}/#search`, + target: `${settings.url}/recherche?s={query}`, + query: 'required', + 'query-input': 'required name=query', }; return ( @@ -94,6 +102,12 @@ const Layout = ({ type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }} ></script> + <script + type="application/ld+json" + dangerouslySetInnerHTML={{ + __html: JSON.stringify(searchActionSchema), + }} + ></script> </Head> <noscript> <div className={styles['noscript-spacing']}></div> |
