1 line
7.5 KiB
JavaScript
1 line
7.5 KiB
JavaScript
import{p as c,c as Y,a as p,f as g}from"./props-b4vEeO_8.js";import{G,B as z,C as h,F as t,k as r,N as d,J as R,ab as H}from"./runtime-C3rQLW--.js";import{i as K}from"./lifecycle-F2p_Qkk3.js";import{c as Q,d as X}from"./create-runtime-stories-7AWWVphH.js";import{h as Z}from"./svelte-head-xbEMkVns.js";import{i as $}from"./svelte-component-C8Ginrj8.js";import{k as ee}from"./key-BFGg-sHz.js";import{h as P}from"./html-CPeakWmR.js";import{s as i}from"./attributes-Cg6aLqN3.js";var te=g('<meta name="twitter:image:alt"/>'),ie=g('<meta name="description"/> <link rel="canonical"/> <link rel="icon" type="image/png" href="https://graphics.thomsonreuters.com/style-assets/images/logos/favicon/favicon-96x96.png" sizes="96x96"/> <link rel="icon" type="image/svg+xml" href="https://graphics.thomsonreuters.com/style-assets/images/logos/favicon/kinesis.svg"/> <link rel="shortcut icon" type="image/x-icon" href="https://graphics.thomsonreuters.com/style-assets/images/logos/favicon/favicon.ico"/> <link rel="apple-touch-icon" sizes="180x180" href="https://graphics.thomsonreuters.com/style-assets/images/logos/favicon/apple-touch-icon.png"/> <meta property="og:url"/> <meta property="og:type" content="article"/> <meta property="og:title" itemprop="name"/> <meta property="og:description" itemprop="description"/> <meta property="og:image" itemprop="image"/> <meta property="og:site_name" content="Reuters"/> <meta name="twitter:card" content="summary_large_image"/> <meta name="twitter:site" content="@ReutersGraphics"/> <meta name="twitter:creator" content="@ReutersGraphics"/> <meta name="twitter:domain"/> <meta name="twitter:title"/> <meta name="twitter:description"/> <meta name="twitter:image"/> <!> <meta property="fb:app_id" content="319194411438328"/> <meta property="fb:admins" content="616167736"/> <meta property="fb:admins" content="625796953"/> <meta property="fb:admins" content="571759798"/> <!> <!>',1);function q(y,e){z(e,!0);let s=c(e,"shareImgAlt",3,""),n=c(e,"publishTime",3,""),F=c(e,"updateTime",3,""),u=c(e,"authors",19,()=>[]);const f=a=>{try{return new URL(a).origin}catch{return typeof window<"u"?f(window.location.href):""}};let b=d(()=>f(e.baseUrl)),o=d(()=>{var a;return(r(b)+(((a=e.pageUrl)==null?void 0:a.pathname)||"")).replace(/index\.html\/$/,"")});const V={"@context":"http://schema.org","@type":"NewsMediaOrganization","@id":"https://www.reuters.com/#publisher",name:"Reuters",logo:{"@type":"ImageObject",url:"https://s3.reutersmedia.net/resources_v2/images/reuters_social_logo.png",width:"200",height:"200"},url:"https://www.reuters.com/"};let C=d(()=>({"@context":"http://schema.org","@type":"NewsArticle",headline:e.seoTitle,url:r(o),mainEntityOfPage:{"@type":"WebPage","@id":r(o)},thumbnailUrl:e.shareImgPath,image:[{"@context":"http://schema.org","@type":"ImageObject",url:e.shareImgPath}],publisher:{"@id":"https://www.reuters.com/#publisher"},copyrightHolder:{"@id":"https://www.reuters.com/#publisher"},sourceOrganization:{"@id":"https://www.reuters.com/#publisher"},copyrightYear:new Date().getFullYear(),dateCreated:n(),datePublished:n(),dateModified:F(),author:u().map(({name:a,link:l})=>({"@type":"Person",name:a,url:l})),creator:u().map(({name:a})=>a),articleSection:"Graphics",isAccessibleForFree:!0,keywords:["Reuters graphics","Reuters","graphics","Interactives"]}));Z(a=>{var l=Y(),M=h(l);ee(M,()=>r(o),N=>{var v=ie(),w=h(v),k=t(w,2),_=t(k,10),S=t(_,4),O=t(S,2),x=t(O,2),I=t(x,10),T=t(I,2),U=t(T,2),D=t(U,2),j=t(D,2);{var W=m=>{var E=te();R(()=>i(E,"content",s())),p(m,E)};$(j,m=>{s()&&m(W)})}var A=t(j,10);P(A,()=>`<script type="application/ld+json">${JSON.stringify(V)}<\/script>`);var B=t(A,2);P(B,()=>`<script type="application/ld+json">${JSON.stringify(r(C))}<\/script>`),R(()=>{H.title=e.seoTitle,i(w,"content",e.seoDescription),i(k,"href",r(o)),i(_,"content",r(o)),i(S,"content",e.shareTitle),i(O,"content",e.shareDescription),i(x,"content",e.shareImgPath),i(I,"content",r(b)),i(T,"content",e.shareTitle),i(U,"content",e.shareDescription),i(D,"content",e.shareImgPath)}),p(N,v)}),p(a,l)}),G()}q.__docgen={data:[{name:"baseUrl",visibility:"public",description:"Base url for the page, which in [Vite-based projects](https://vitejs.dev/guide/build.html#public-base-path) is globally available as `import.meta.env.BASE_URL`.",keywords:[{name:"required",description:""}],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"pageUrl",visibility:"public",description:"[URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object for the page.",keywords:[{name:"required",description:""}],kind:"let",type:{kind:"type",type:"object",text:"URL"},static:!1,readonly:!1},{name:"seoTitle",visibility:"public",description:"SEO title",keywords:[{name:"required",description:""}],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"seoDescription",visibility:"public",description:"SEO description",keywords:[{name:"required",description:""}],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"shareTitle",visibility:"public",description:"Share title",keywords:[{name:"required",description:""}],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"shareDescription",visibility:"public",description:"Share description",keywords:[{name:"required",description:""}],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"shareImgPath",visibility:"public",description:"Share image path. **Must be an absolute path.**",keywords:[{name:"required",description:""}],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"shareImgAlt",visibility:"public",description:"Share image alt text, up to 420 characters.",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1,defaultValue:'""'},{name:"publishTime",visibility:"public",description:"Publish time as an [ISO string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1,defaultValue:'""'},{name:"updateTime",visibility:"public",description:"Updated time as an [ISO string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1,defaultValue:'""'},{name:"authors",visibility:"public",description:"Array of authors for the piece. Each author object must have `name` and `link` attributes.",keywords:[],kind:"let",type:{kind:"type",type:"array",text:"GraphicAuthor[]"},static:!1,readonly:!1,defaultValue:"[]"}],name:"SEO.svelte"};const J={title:"Components/Ads & analytics/SEO",component:q},{Story:ae}=X();var re=g("<div>View page source to see the SEO metadata.</div> <!>",1);function L(y,e){z(e,!1),K();var s=re(),n=t(h(s),2);ae(n,{name:"Demo",args:{baseUrl:"https://www.reuters.com",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"},parameters:{__svelteCsf:{rawCode:"<SEO {...args} />"}}}),p(y,s),G()}L.__docgen={version:3,name:"SEO.stories.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const se=Q(L,J),oe=["Demo"],ne=se.Demo,fe=Object.freeze(Object.defineProperty({__proto__:null,Demo:ne,__namedExportsOrder:oe,default:J},Symbol.toStringTag,{value:"Module"}));export{ne as D,fe as S};
|