ng-simple-seo
Version:
A very light weight seo mechanism that adds all the necessary meta tags to your Angular Application 🚊
102 lines (72 loc) • 2.54 kB
Markdown
A very light weight seo mechanism that adds all the necessary meta tags to your Angular Application 🚊
- Get more visitors from Google and Bing.
- Attract more visitors from social media.
- Increase your readers’ engagement.
- Change the title of each page dynamically.
>npm i ng-simple-seo
First add `NgSimpleSeoModule` to Imports array of your app module.
```javascript
import { NgSimpleSeoModule } from 'ng-simple-seo';
@NgModule({
imports: [
...,
NgSimpleSeoModule,
...
]
})
```
Then just add `<ng-simple-seo></ng-simple-seo>`
with one or more attributes in your template.
🎉 All attributes are optional and can take values coming from a server as inputs.
```html
<ng-simple-seo
[] = "'The Blog | ' + data.post.title"
[] = "'tech blog, web app, angular app'"
[] = "'A Blog about technology'"
[] = "'The Blog'"
[] = "'Blog Site'"
[] = "'website'"
><ng-simple-seo>
<!-- app.component.html -->
```
By set the [title] attribute, you can change the title of each page dynamically.
See example bellow:
`<ng-simple-seo [title]="'Dynamic Title'"></ng-simple-seo>`
will generate this:

Name | Description
------------- | -------------
title | Current page title
keywords | Current page keywords
description | Description of your application
twitterTitle | Title of content
twitterDescription | Description of content (maximum 200 characters)
twitterImage | Current page thumbnail image URL for Twitter
twitterSite | Either your twitter:site or twitter:site:id
twitterCreator | Your twitter username
ogTitle | Current page title for Facebook
ogType | Current page type for Facebook
ogDescription | Current page description for Facebook
ogImage | Current page thumbnail image URL for Facebook
ogUrl | Current page URL for Facebook
## Lib Dependencies
```shell
"peerDependencies": {
"@angular/common": "^9.1.12",
"@angular/core": "^9.1.12"
},
"dependencies": {
"tslib": "^1.10.0"
},
```
Run `ng test ng-simple-seo` to execute the unit tests via [Karma](https://karma-runner.github.io).
[](https://choosealicense.com/licenses/mit/)