65 lines
4 KiB
JavaScript
65 lines
4 KiB
JavaScript
import{j as e}from"./index-bIIEL2MP.js";import{useMDXComponents as s}from"./index-CO-0pc0F.js";import{M as o,C as i}from"./index-Z-6k0Xrj.js";import{S as a,D as c}from"./SEO.stories-DHK5HV88.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iframe-CzjIX-qr.js";import"./index-aQYXhgXp.js";import"./index-DrFu-skq.js";import"./props-b4vEeO_8.js";import"./runtime-C3rQLW--.js";import"./lifecycle-F2p_Qkk3.js";import"./create-runtime-stories-7AWWVphH.js";import"./snippet-C5kbqVpq.js";import"./svelte-component-C8Ginrj8.js";import"./get-C3XmtPLd.js";import"./svelte-head-xbEMkVns.js";import"./key-BFGg-sHz.js";import"./html-CPeakWmR.js";import"./attributes-Cg6aLqN3.js";import"./style-DvJ3IcV1.js";function n(t){const r={blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",p:"p",pre:"pre",strong:"strong",...s(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(o,{of:a}),`
|
|
`,e.jsx(r.h1,{id:"seo",children:"SEO"}),`
|
|
`,e.jsxs(r.p,{children:["The ",e.jsx(r.code,{children:"SEO"})," component adds essential metadata to pages."]}),`
|
|
`,e.jsx(r.pre,{children:e.jsx(r.code,{className:"language-svelte",children:`<script>
|
|
import { SEO } from '@reuters-graphics/graphics-components';
|
|
<\/script>
|
|
|
|
<SEO
|
|
baseUrl="https://www.reuters.com/graphics/world-coronavirus-tracker-and-maps"
|
|
pageUrl={new URL(
|
|
'https://www.reuters.com/graphics/world-coronavirus-tracker-and-maps/countries/united-kingdom/'
|
|
)}
|
|
seoTitle="A title for Google"
|
|
seoDescription="A description for Google"
|
|
shareTitle="A title for Twitter/Facebook"
|
|
shareDescription="A description for Twitter/Facebook"
|
|
shareImgPath="https://www.reuters.com/graphics/world-coronavirus-tracker-and-maps/assets/images/share.jpg"
|
|
shareImgAlt="An image showing global COVID infection rates"
|
|
publishTime="2020-09-15T00:00:00.000Z"
|
|
updateTime="2021-01-10T12:30:00.000Z"
|
|
authors={[
|
|
{ name: 'Jane Doe', link: 'https://www.reuters.com/authors/jane-doe/' },
|
|
{ name: 'John Doe', link: 'https://www.reuters.com/authors/john-doe/' },
|
|
]}
|
|
/>
|
|
`})}),`
|
|
`,e.jsx(r.h2,{id:"using-with-archieml-docs",children:"Using with ArchieML docs"}),`
|
|
`,e.jsx(r.p,{children:"With the graphics kit, you'll likely get many of your text values from an ArchieML doc..."}),`
|
|
`,e.jsx(r.pre,{children:e.jsx(r.code,{className:"language-yaml",children:`# ArchieML doc
|
|
slug: ROOT-SLUG/WILD
|
|
seoTitle: Page title for search
|
|
seoDescription: Page description for search
|
|
shareTitle: Page title for social media
|
|
shareDescription: Page description for social media
|
|
shareImgPath: images/reuters-graphics.jpg
|
|
shareImgAlt: Alt text for share image.
|
|
`})}),`
|
|
`,e.jsxs(r.p,{children:["... which you'll pass to the ",e.jsx(r.code,{children:"SEO"})," component."]}),`
|
|
`,e.jsx(r.pre,{children:e.jsx(r.code,{className:"language-svelte",children:`<script>
|
|
import { SEO } from '@reuters-graphics/graphics-components';
|
|
import pkg from '$pkg';
|
|
import content from '$locales/en/content.json';
|
|
import { assets } from '$app/paths';
|
|
import { page } from '$app/stores';
|
|
<\/script>
|
|
|
|
<SEO
|
|
baseUrl={VITE_BASE_URL}
|
|
pageUrl={$page.url}
|
|
seoTitle={content.seoTitle}
|
|
seoDescription={content.seoDescription}
|
|
shareTitle={content.shareTitle}
|
|
shareDescription={content.shareDescription}
|
|
shareImgPath={\`\${assets}/\${content.shareImgPath}\`}
|
|
shareImgAlt={content.shareImgAlt}
|
|
publishTime={pkg?.reuters?.graphic?.published}
|
|
updateTime={pkg?.reuters?.graphic?.updated}
|
|
authors={pkg?.reuters?.graphic?.authors}
|
|
/>
|
|
`})}),`
|
|
`,e.jsxs(r.blockquote,{children:[`
|
|
`,e.jsxs(r.p,{children:[e.jsx(r.strong,{children:"Note:"})," For ",e.jsx(r.em,{children:"reasons"}),", we can't document the value of ",e.jsx(r.code,{children:"VITE_BASE_URL"})," below. It's ",e.jsx(r.code,{children:"import"})," + ",e.jsx(r.code,{children:".meta.env.BASE_URL"})," (concatenate all that) in the graphics kit and other Vite-based rigs."]}),`
|
|
`]}),`
|
|
`,e.jsx(i,{of:c}),`
|
|
`,e.jsx(r.pre,{children:e.jsx(r.code,{})})]})}function L(t={}){const{wrapper:r}={...s(),...t.components};return r?e.jsx(r,{...t,children:e.jsx(n,{...t})}):n(t)}export{L as default};
|