You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

59 lines
1.0 KiB

  1. import React from 'react';
  2. import Head from 'next/head';
  3. export default function SEO({
  4. description = 'startup landing descriptions',
  5. author = 'RedQ, Inc',
  6. meta,
  7. title = 'startup landing title',
  8. }) {
  9. const metaData = [
  10. {
  11. name: `description`,
  12. content: description,
  13. },
  14. {
  15. property: `og:title`,
  16. content: title,
  17. },
  18. {
  19. property: `og:description`,
  20. content: description,
  21. },
  22. {
  23. property: `og:type`,
  24. content: `website`,
  25. },
  26. {
  27. name: `twitter:card`,
  28. content: `summary`,
  29. },
  30. {
  31. name: `twitter:creator`,
  32. content: author,
  33. },
  34. {
  35. name: `twitter:title`,
  36. content: title,
  37. },
  38. {
  39. name: `twitter:description`,
  40. content: description,
  41. },
  42. ].concat(meta);
  43. return (
  44. <Head>
  45. <title>{title}</title>
  46. {metaData.map(({ name, content }, i) => (
  47. <meta key={i} name={name} content={content} />
  48. ))}
  49. </Head>
  50. );
  51. }
  52. SEO.defaultProps = {
  53. lang: `en`,
  54. meta: [],
  55. description: ``,
  56. };