Skip to content
Snippets Groups Projects
Commit c20f30d6 authored by Tojo Andrianomentsoaniaina's avatar Tojo Andrianomentsoaniaina Committed by Julien MARGAIL
Browse files

Feat/layout

parent 39153a30
No related branches found
No related tags found
No related merge requests found
......@@ -18,11 +18,17 @@ interface Props {
* @returns {JSX.Element} The complete page
*/
const Layout = ({ children }: Props): JSX.Element => {
const query = useStaticQuery(graphql`
query LayoutQuery {
site {
siteMetadata {
icon
const data = useStaticQuery(graphql`
query {
directus {
site {
icon {
id
imageFile {
id
publicURL
}
}
}
}
}
......@@ -33,7 +39,7 @@ const Layout = ({ children }: Props): JSX.Element => {
<Helmet>
<link
rel="icon"
href={query.site.siteMetadata.icon}
href={data.directus.site?.icon?.imageFile?.publicURL}
type="image/png"
/>
</Helmet>
......
import React from "react";
import { Helmet } from "react-helmet";
import { useStaticQuery, graphql } from "gatsby";
import React from "react"
import { Helmet } from "react-helmet"
import { useStaticQuery, graphql } from "gatsby"
const SEO = () => {
const query = useStaticQuery(
graphql`
query SeoQuery {
site {
siteMetadata {
title
description
author
theme
}
const data = useStaticQuery(graphql`
query {
directus {
site {
id
theme
title
description
author
}
}
}
}
`
);
const dt = query.site.siteMetadata;
`)
const dt = data.directus.site
return (
<Helmet
htmlAttributes={{
lang: `fr`,
"data-theme": dt.theme,
}}
title={dt.title}
meta={[
{
name: `description`,
content: dt.description,
},
{
property: `og:title`,
content: dt.title,
},
{
property: `og:description`,
content: dt.description,
},
{
property: `og:type`,
content: `website`,
},
{
name: `twitter:card`,
content: `summary`,
},
{
name: `twitter:creator`,
content: dt.author,
},
{
name: `twitter:title`,
content: dt.title,
},
{
name: `twitter:description`,
content: dt.description,
},
]}
/>
);
};
return (
<Helmet
htmlAttributes={{
lang: `fr`,
"data-theme": dt?.theme,
}}
title={dt?.title}
meta={[
{
name: `description`,
content: dt?.description,
},
{
property: `og:title`,
content: dt?.title,
},
{
property: `og:description`,
content: dt?.description,
},
{
property: `og:type`,
content: `website`,
},
{
name: `twitter:card`,
content: `summary`,
},
{
name: `twitter:creator`,
content: dt?.author,
},
{
name: `twitter:title`,
content: dt?.title,
},
{
name: `twitter:description`,
content: dt?.description,
},
]}
/>
)
}
export default SEO;
export default SEO
......@@ -71,7 +71,7 @@ const menu = () => {
<div>
<h3 className="underline underline-offset-1">Menu Footer</h3>
<div className="flex gap-6 m-4">
<Menu name='Footer'/>
<Menu name='Footer' className="menu menu-horizontal p-0"/>
</div>
</div>
</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