Skip to content
Snippets Groups Projects
Commit 567fb04a authored by Julien MARGAIL's avatar Julien MARGAIL
Browse files

Merge branch 'feat/layout' into 'main'

Feat/layout

See merge request onegeo/gatsby-theme-onegeo!49
parents 39153a30 c20f30d6
No related branches found
No related tags found
No related merge requests found
...@@ -18,11 +18,17 @@ interface Props { ...@@ -18,11 +18,17 @@ interface Props {
* @returns {JSX.Element} The complete page * @returns {JSX.Element} The complete page
*/ */
const Layout = ({ children }: Props): JSX.Element => { const Layout = ({ children }: Props): JSX.Element => {
const query = useStaticQuery(graphql` const data = useStaticQuery(graphql`
query LayoutQuery { query {
site { directus {
siteMetadata { site {
icon icon {
id
imageFile {
id
publicURL
}
}
} }
} }
} }
...@@ -33,7 +39,7 @@ const Layout = ({ children }: Props): JSX.Element => { ...@@ -33,7 +39,7 @@ const Layout = ({ children }: Props): JSX.Element => {
<Helmet> <Helmet>
<link <link
rel="icon" rel="icon"
href={query.site.siteMetadata.icon} href={data.directus.site?.icon?.imageFile?.publicURL}
type="image/png" type="image/png"
/> />
</Helmet> </Helmet>
......
import React from "react"; import React from "react"
import { Helmet } from "react-helmet"; import { Helmet } from "react-helmet"
import { useStaticQuery, graphql } from "gatsby"; import { useStaticQuery, graphql } from "gatsby"
const SEO = () => { const SEO = () => {
const query = useStaticQuery( const data = useStaticQuery(graphql`
graphql` query {
query SeoQuery { directus {
site { site {
siteMetadata { id
title theme
description title
author description
theme author
} }
}
} }
} `)
` const dt = data.directus.site
);
const dt = query.site.siteMetadata;
return ( return (
<Helmet <Helmet
htmlAttributes={{ htmlAttributes={{
lang: `fr`, lang: `fr`,
"data-theme": dt.theme, "data-theme": dt?.theme,
}} }}
title={dt.title} title={dt?.title}
meta={[ meta={[
{ {
name: `description`, name: `description`,
content: dt.description, content: dt?.description,
}, },
{ {
property: `og:title`, property: `og:title`,
content: dt.title, content: dt?.title,
}, },
{ {
property: `og:description`, property: `og:description`,
content: dt.description, content: dt?.description,
}, },
{ {
property: `og:type`, property: `og:type`,
content: `website`, content: `website`,
}, },
{ {
name: `twitter:card`, name: `twitter:card`,
content: `summary`, content: `summary`,
}, },
{ {
name: `twitter:creator`, name: `twitter:creator`,
content: dt.author, content: dt?.author,
}, },
{ {
name: `twitter:title`, name: `twitter:title`,
content: dt.title, content: dt?.title,
}, },
{ {
name: `twitter:description`, name: `twitter:description`,
content: dt.description, content: dt?.description,
}, },
]} ]}
/> />
); )
}; }
export default SEO; export default SEO
...@@ -71,7 +71,7 @@ const menu = () => { ...@@ -71,7 +71,7 @@ const menu = () => {
<div> <div>
<h3 className="underline underline-offset-1">Menu Footer</h3> <h3 className="underline underline-offset-1">Menu Footer</h3>
<div className="flex gap-6 m-4"> <div className="flex gap-6 m-4">
<Menu name='Footer'/> <Menu name='Footer' className="menu menu-horizontal p-0"/>
</div> </div>
</div> </div>
</Content> </Content>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment