Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing types and making them available #22

Closed
oekazuma opened this issue Sep 7, 2021 · 1 comment · Fixed by #23
Closed

Importing types and making them available #22

oekazuma opened this issue Sep 7, 2021 · 1 comment · Fixed by #23
Assignees
Labels
enhancement New feature or request released

Comments

@oekazuma
Copy link
Owner

oekazuma commented Sep 7, 2021

Is your feature request related to a problem? Please describe.
Currently, this is inconvenient if you want to import and use a type.

Describe the solution you'd like
type can be imported and used.

Describe alternatives you've considered
Example of use

<script lang="ts">
  import MetaTags, { JsonLd } from 'svelte-meta-tags';
  import type { MetaTagsProps, JsonLdProps } from 'svelte-meta-tags';

  const metatags: MetaTagsProps = {
    title: 'Types | Svelte Meta Tags',
    description: 'Description',
    canonical: 'https://www.canonical.ie/',
    openGraph: {
      type: 'website',
      url: 'https://www.example.com/page',
      locale: 'en_IE',
      title: 'Open Graph Title',
      description: 'Open Graph Description',
      images: [
        {
          url: 'https://www.example.ie/og-image.jpg',
          width: 800,
          height: 600,
          alt: 'Og Image Alt'
        }
      ],
      site_name: 'SiteName'
    },
    twitter: {
      handle: '@handle',
      site: '@site',
      cardType: 'summary_large_image'
    },
    facebook: {
      appId: '1234567890'
    }
  };

  const jsonld: JsonLdProps = {
    schema: {
      '@type': 'NewsArticle',
      mainEntityOfPage: {
        '@type': 'WebPage',
        '@id': 'https://google.com/article'
      },
      headline: 'Article headline',
      image: [
        'https://example.com/photos/1x1/photo.jpg',
        'https://example.com/photos/4x3/photo.jpg',
        'https://example.com/photos/16x9/photo.jpg'
      ],
      datePublished: '2015-02-05T08:00:00+08:00',
      dateModified: '2015-02-05T09:20:00+08:00',
      author: {
        '@type': 'Person',
        name: 'John Doe'
      },
      publisher: {
        '@type': 'Organization',
        name: 'Google',
        logo: {
          '@type': 'ImageObject',
          url: 'https://google.com/logo.jpg'
        }
      }
    }
  };
</script>

<MetaTags {...metatags} />

<JsonLd {...jsonld} />

Additional context
You might want to update the documentation as well.

@oekazuma oekazuma added the enhancement New feature or request label Sep 7, 2021
@oekazuma oekazuma self-assigned this Sep 7, 2021
@oekazuma
Copy link
Owner Author

oekazuma commented Sep 7, 2021

🎉 This issue has been resolved in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant