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

docs: split between utility types and metadata values types #992

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions projects/ngx-meta/docs/content/built-in-modules/json-ld.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,27 @@ The module allows you to embed a JSON-LD object inside a `#!html <script>` tag (
export class AppModule {}
```

## Type
## Utility type

Following Typescript type provides you with all implemented metadata you can set:
Following Typescript type will help you provide metadata values:

```typescript
import { JsonLdMetadata } from '@davidlj95/ngx-meta/json-ld'

const metadata = {
jsonLd: {
'@context': 'https://schema.org/',
'@type': 'Recipe',
name: 'Party Coffee Cake',
author: {
'@type': 'Person',
name: 'Mary Stone',
},
datePublished: '2018-03-10',
description: 'This coffee cake is awesome and perfect for parties.',
prepTime: 'PT20M',
},
} satisfies JsonLdMetadata
```

[`JsonLdMetadata` API Reference](ngx-meta.jsonldmetadata.md)
Expand Down
31 changes: 27 additions & 4 deletions projects/ngx-meta/docs/content/built-in-modules/open-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This module will help you set those tags to provide metadata to social networks

## Setup

Depending on what metadata you need to set, add one of more of the Open Graph modules / providers.
Depending on what metadata you need to set, add one of more of the Open Graph providers.

### Main

Expand Down Expand Up @@ -60,6 +60,14 @@ Specifically, manages [basic](https://ogp.me/#metadata) and [optional](https://o
export class AppModule {}
```

#### Metadata

To check all the metadata that can be set with this provider, check out

[`OpenGraph` API Reference](ngx-meta.opengraph.md)

> Except if the property indicates otherwise, like `profile`.

### Profile

Manages [profile](https://ogp.me/#type_profile) non-vertical metadata. Manages metadata under [`OpenGraph.profile`](ngx-meta.opengraph.profile.md)
Expand Down Expand Up @@ -108,12 +116,27 @@ Manages [profile](https://ogp.me/#type_profile) non-vertical metadata. Manages m
export class AppModule {}
```

## Type
#### Metadata

To check all the metadata that can be set with this provider, check out

[`OpenGraphProfile` API Reference](ngx-meta.opengraphprofile.md)

## Utility type

Following Typescript type provides you with all implemented metadata you can set:
Following Typescript type will help you provide metadata values:

```typescript
import { OpenGraphMetadata } from '@davidlj95/ngx-meta/open-graph'
import { OpenGraphMetadata, OPEN_GRAPH_TYPE_WEBSITE } from '@davidlj95/ngx-meta/open-graph'

const metadata = {
openGraph: {
type: OPEN_GRAPH_TYPE_WEBSITE,
profile: {
username: 'angular',
},
},
} satisfies OpenGraphMetadata
```

[`OpenGraphMetadata` API Reference](ngx-meta.opengraphmetadata.md)
Expand Down
18 changes: 15 additions & 3 deletions projects/ngx-meta/docs/content/built-in-modules/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This module allows managing HTML `#!html <meta>` tags whose [`name` attribute is

## Setup

Depending on what metadata you need to set, add one of more of the following modules / providers.
Depending on what metadata you need to set, add one of more of the following providers.

### Main

Expand Down Expand Up @@ -52,12 +52,24 @@ Depending on what metadata you need to set, add one of more of the following mod
export class AppModule {}
```

## Type
#### Metadata

Following Typescript type provides you with all implemented metadata you can set:
To check all the metadata that can be set with this module, check out

[`Standard` API Reference](ngx-meta.standard.md)

## Utility type

Following Typescript type will help you provide metadata values:

```typescript
import { StandardMetadata } from '@davidlj95/ngx-meta/standard'

const metadata = {
standard: {
keywords: ['cool', 'site'],
},
} satisfies StandardMetadata
```

[`StandardMetadata` API Reference](ngx-meta.standardmetadata.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Some [Twitter Cards tags fallback to Open Graph equivalent properties if they ca

## Setup

Depending on what metadata you need to set, add one of more of the Twitter Card modules / providers.
Depending on what metadata you need to set, add one of more of the Twitter Card providers.

### Main

Expand Down Expand Up @@ -58,12 +58,24 @@ To set the Twitter Card type or the basic _summary_ or _summary large_ cards, yo
export class AppModule {}
```

## Type
#### Metadata

Following Typescript type provides you with all implemented metadata you can set:
To check all the metadata that can be set with this provider, check out

[`TwitterCard` API Reference](ngx-meta.twittercard.md)

## Utility type

Following Typescript type will help you provide metadata values:

```typescript
import { TwitterCardMetadata } from '@davidlj95/ngx-meta/twitter-card'

const metadata = {
twitterCard: {
site: { username: '@angular' },
},
} satisfies TwitterCardMetadata
```

[`TwitterCardMetadata` API Reference](ngx-meta.twittercardmetadata.md)
Expand Down