"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8566],{6698:(e,n,t)=>{t.d(n,{Z:()=>d});var a=t(24246),s=(t(27378),t(40624));const o={browserWindow:"browserWindow_my1Q",browserWindowHeader:"browserWindowHeader_jXSR",row:"row_KZDM",buttons:"buttons_uHc7",right:"right_oyze",browserWindowAddressBar:"browserWindowAddressBar_Pd8y",dot:"dot_giz1",browserWindowMenuIcon:"browserWindowMenuIcon_Vhuh",bar:"bar_rrRL",browserWindowBody:"browserWindowBody_Idgs"};function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e){for(var n=1;n{t.d(n,{Z:()=>a});const a=t.p+"assets/images/docusaurus-asset-example-banner-63decf1180b7949f4c3d0f7b7ecfd162.png"},66259:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>r,metadata:()=>c,toc:()=>l});var a=t(24246),s=t(71670),o=t(6698);const r={description:"How to make your Docusaurus site maximally search-engine-friendly.",sidebar_label:"SEO",keywords:["seo","positioning"]},i="Search engine optimization (SEO)",c={id:"seo",title:"Search engine optimization (SEO)",description:"How to make your Docusaurus site maximally search-engine-friendly.",source:"@site/docs/seo.mdx",sourceDirName:".",slug:"/seo",permalink:"/docs/seo",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/edit/main/website/docs/seo.mdx",tags:[],version:"current",lastUpdatedBy:"Azzedine E",lastUpdatedAt:1717065341e3,frontMatter:{description:"How to make your Docusaurus site maximally search-engine-friendly.",sidebar_label:"SEO",keywords:["seo","positioning"]},sidebar:"docs",previous:{title:"Browser support",permalink:"/docs/browser-support"},next:{title:"Using Plugins",permalink:"/docs/using-plugins"}},d={},l=[{value:"Global metadata",id:"global-metadata",level:2},{value:"Single page metadata",id:"single-page-metadata",level:2},{value:"Static HTML generation",id:"static-html-generation",level:2},{value:"Image meta description",id:"image-meta-description",level:2},{value:"Rich search information",id:"rich-search-information",level:2},{value:"Robots file",id:"robots-file",level:2},{value:"Sitemap file",id:"sitemap-file",level:2},{value:"Human readable links",id:"human-readable-links",level:2},{value:"Structured content",id:"structured-content",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{id:"search-engine-optimization-seo",children:"Search engine optimization (SEO)"}),"\n","\n",(0,a.jsx)(n.p,{children:"Docusaurus supports search engine optimization in a variety of ways."}),"\n",(0,a.jsx)(n.h2,{id:"global-metadata",children:"Global metadata"}),"\n",(0,a.jsxs)(n.p,{children:["Provide global meta attributes for the entire site through the ",(0,a.jsx)(n.a,{href:"/docs/configuration#site-metadata",children:"site configuration"}),". The metadata will all be rendered in the HTML ",(0,a.jsx)(n.code,{children:""})," using the key-value pairs as the prop name and value. The ",(0,a.jsx)(n.code,{children:"metadata"})," attribute is a convenient shortcut to declare ",(0,a.jsx)(n.code,{children:""})," tags, but it is also possible to inject arbitrary tags in ",(0,a.jsx)(n.code,{children:""})," with the ",(0,a.jsx)(n.code,{children:"headTags"})," attribute."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n themeConfig: {\n // Declare some tags\n metadata: [\n {name: 'keywords', content: 'cooking, blog'},\n {name: 'twitter:card', content: 'summary_large_image'},\n ],\n },\n headTags: [\n // Declare a preconnect tag\n {\n tagName: 'link',\n attributes: {\n rel: 'preconnect',\n href: 'https://example.com',\n },\n },\n // Declare some json-ld structured data\n {\n tagName: 'script',\n attributes: {\n type: 'application/ld+json',\n },\n innerHTML: JSON.stringify({\n '@context': 'https://schema.org/',\n '@type': 'Organization',\n name: 'Meta Open Source',\n url: 'https://opensource.fb.com/',\n logo: 'https://opensource.fb.com/img/logos/Meta-Open-Source.svg',\n }),\n },\n ],\n};\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Docusaurus adds some metadata out-of-the-box. For example, if you have configured ",(0,a.jsx)(n.a,{href:"/docs/i18n/introduction",children:"i18n"}),", you will get a ",(0,a.jsx)(n.a,{href:"https://developers.google.com/search/docs/advanced/crawling/localized-versions",children:(0,a.jsx)(n.code,{children:"hreflang"})})," alternate link."]}),"\n",(0,a.jsxs)(n.p,{children:["To read more about types of meta tags, visit ",(0,a.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta",children:"the MDN docs"}),"."]}),"\n",(0,a.jsx)(n.h2,{id:"single-page-metadata",children:"Single page metadata"}),"\n",(0,a.jsxs)(n.p,{children:["Similar to ",(0,a.jsx)(n.a,{href:"#global-metadata",children:"global metadata"}),", Docusaurus also allows for the addition of meta-information to individual pages. Follow ",(0,a.jsx)(n.a,{href:"/docs/markdown-features/head-metadata",children:"this guide"})," for configuring the ",(0,a.jsx)(n.code,{children:""})," tag. In short:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-md",metastring:'title="my-markdown-page.mdx"',children:"# A cooking guide\n\n\n \n \n \n