@jill64/svelte-ogp

npm-version npm-license npm-download-month npm-min-size ci.yml website

🖼️ Quick OGP configuration for SvelteKit

▷ Installation
Open DevTools and make sure OGP is set.
// hooks.server.js
export { attach as handle } from '@jill64/svelte-ogp'
<!-- +layout.svelte -->
<script>
  import { OGP } from '@jill64/svelte-ogp'
</script>

<OGP
  title="@jill64/svelte-ogp"
  description="🖼️ Quick OGP configuration for SvelteKit"
  site_name="@jill64/svelte-ogp"
  image="/og-image.png"
/>

Converted HTML

<html prefix="og: https://ogp.me/ns#">
  <head>
    <meta property="og:title" content="@jill64/svelte-ogp">
    <meta property="og:type" content="website">
    <meta property="og:image" content="https://svelte-ogp.jill64.dev/og-image.png">
    <meta property="og:url" content="https://svelte-ogp.jill64.dev/">
    <meta property="og:description" content="🖼️ Quick OGP configuration for SvelteKit">
    <meta property="og:site_name" content="@jill64/svelte-ogp">
    <meta name="twitter:card" content="summary_large_image">
    <!-- ... -->
  </head>
  <!-- ... -->
</html>