image

Cache clear

:

 const description = props.json.descriptions
   .map((line) => line.replace(/\[.*?\]/g, ""))
   .join(" ");

 return (
   <>
     <Head>
       <title>{title} - NISHIO Hirokazu</title>
       <meta name="twitter:card" content="summary_large_image" />
       <meta name="twitter:site" content="nishio" />
       <meta name="twitter:title" content={title} />
       <meta name="twitter:description" content={description} />
       <meta name="twitter:image" content={props.json.image} />
     </Head>

old title Twitter Cards Start using your card - Twitter Developers

  • How to combine with Open Graph tags is written at the end. ts
<meta name="twitter:card" content="summary" />
<meta name="twitter:creator" content="@nishio" />
<meta property="og:url" content="https://shinuwani.netlify.com/" />
<meta property="og:title" content="You who will die in ___ years" />
<meta property="og:description" content="I made this because I was watching the cartoon "The Crocodile Who Dies in 100 Days" and was wondering how long I would be dead." />
<meta property="og:image" content="https://shinuwani.netlify.com/shinuwani.jpg" />

There was a suggestion to use react-helmet, but we decided it was better to modify the head directly since it is a single file for a single page.


This page is auto-translated from [/nishio/Twitter Card](https://scrapbox.io/nishio/Twitter Card) using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.