# gridsome-plugin-static-metadata

> Gridsome plugin to add global static metadata.

Latest version **0.0.1** (published 2022-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install gridsome-plugin-static-metadata
pnpm add gridsome-plugin-static-metadata
yarn add gridsome-plugin-static-metadata
bun add gridsome-plugin-static-metadata
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-02-22 |
| First published | 2022-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Antonio R |
| Maintainers | a133x |
| Keywords | gridsome, gridsome-plugin, metadata, static metadata, vue-meta |

## Links

- npm: https://www.npmjs.com/package/gridsome-plugin-static-metadata
- Repository: https://github.com/a133xz/gridsome-plugin-static-metadata
- Homepage: https://github.com/a133xz/gridsome-plugin-static-metadata#readme
- Issues: https://github.com/a133xz/gridsome-plugin-static-metadata/issues
- npm.io page: https://npm.io/package/gridsome-plugin-static-metadata

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2022-02-22

## README

# gridsome-plugin-static-metadata

Gridsome plugin to add global static metadata.

When building a microsite or a small site with Gridsome, you might want to add Open Graph (and Twitter) meta tags that control how URLs are displayed when shared on social media. With this plugin you can do it in the Gridsome config file.

Check below to see all the tags that will be included.

## Install

- `npm install gridsome-plugin-static-metadata`
- `yarn add gridsome-plugin-static-metadata`
- `pnpm install gridsome-plugin-static-metadata`

## Basic usage

The `siteName` `siteDescription` and `siteUrl` properties must be defined in the `gridsome.config.js` file of your project

```js
//gridsome.config.js
module.exports = {
  siteName: 'MySite Name',
  siteDescription: 'MySite description',
  siteUrl: 'https://mysiteurl.com/',
  plugins: [
    {
      use: 'gridsome-plugin-static-metadata',
      options: {
        // To replace siteName
        title: '',
        image: '/meta.png',
        themeColor: '#171c31',
        lang: 'es',
        locale: 'es_ES'
        robots: true,
      },
    },
  ],
}
```

## Tags

```html
<meta property="og:type" content="website" />
<meta property="og:url" content="https://mysiteurl.com/" />
<meta property="og:title" content="MySite Name" />
<meta property="og:description" content="MySite description" />
<meta property="og:image" content="/meta.png" />
<meta property="og:locale" content="es_ES" />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://mysiteurl.com/" />
<meta property="twitter:title" content="MySite Name" />
<meta property="twitter:description" content="MySite description" />
<meta property="twitter:image" content="/meta.png" />
<meta name="theme-color" content="#171c31" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta data-key="description" name="description" content="MySite description" />
```

## Options on `gridsome.config.js`

#### siteName

- Type: `string`
- Default: ``

Title for `twitter:title` and `og:title` property

#### siteDescription

- Type: `string`
- Default: ``

Description for `twitter:description` and `og:description` property

#### siteUrl

- Type: `string`
- Default: ``

Url for `twitter:url` and `og:url` property

## Plugin options

#### title

- Type: `string`
- Default: (siteName property above)

Optional property to replace `siteName`, so you can use it as a variable

#### image

- Type: `string`
- Default: ``

Image for `twitter:image` and `og:url` property

#### themeColor

- Type: `string`
- Default: ``

Theme color for `theme-color` meta property

#### locale

- Type: `string`
- Default: ``

Set `og:locale` property language

#### lang

- Type: `string`
- Default: ``

Lang for `htmlAttrs` of the page

#### robots

- Type: `boolean`
- Default: `false`

If true `<meta name="robots" content="index,follow" />` will be added

---
_Source: https://npm.io/package/gridsome-plugin-static-metadata · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
