SeoHelper 2.0.0
dotnet add package SeoHelper --version 2.0.0
NuGet\Install-Package SeoHelper -Version 2.0.0
<PackageReference Include="SeoHelper" Version="2.0.0" />
<PackageVersion Include="SeoHelper" Version="2.0.0" />
<PackageReference Include="SeoHelper" />
paket add SeoHelper --version 2.0.0
#r "nuget: SeoHelper, 2.0.0"
#:package SeoHelper@2.0.0
#addin nuget:?package=SeoHelper&version=2.0.0
#tool nuget:?package=SeoHelper&version=2.0.0
SeoHelper
This package helps you to add meta-tags, sitemap.xml and robots.txt into your project easily.
Usage
- Install the package via Nuget.
Install-Package SeoHelper -Version 2.0.0
or
dotnet add package SeoHelper --version 2.0.0
- Add following service registrations to
ConfigureServices
method in Startup.cs.
Note: You can define your seo options (meta-tags, sitemap.xml and robots.txt) either specifying them in
SeoOptions
class or appsettings.json (under a section. E.g: SeoOptions or SeoConfigurations).
services.AddSeo(Configuration, sectionName: "SeoOptions");
If you want to specify your options via appsettings.json. You can create a section named whatever you want ("SeoOptions" in above usage) and specify it in the related service configuration method (AddSeo).
"SeoOptions": {
"MetaTags": [
{
"RelativeUrl": "/demo",
"Title": "demo title",
"Charset": "UTF-8",
"MetaTagDescriptions": {
"Author": "author",
"Description": "description",
"Keywords": "keywords"
}
},
{
"RelativeUrl": "/",
"Title": "index title",
"Charset": "UTF-8",
"MetaTagDescriptions": {
"author": "author",
"description": "description"
}
}
],
"Sitemap": {
"Urls": [
{
"Url": "/article/1",
"LastModificationDate": "12/12/2012"
},
{
"Url": "/article/2",
"LastModificationDate": "12/12/2012",
"Priority": 1.0
}
]
},
"RobotsTxt": {
"DisplaySitemapUrl": true,
"RobotsTxtSections": [
{
"UserAgent": "/google",
"DisallowUrls": ["/account/manage", "/account/login"],
"AllowUrls": ["/", "/home-page"]
},
{
"UserAgent": "/yandex",
"DisallowUrls": ["/account/manage", "/account/login"],
"AllowUrls": ["*"]
}
]
},
"OpenGraph": {
"Twitter": {
"Site": "@EngincanVeske",
"Creator": "@EngincanVeske"
},
"Pages": [
{
"Url": "/",
"OgTitle": "og-title",
"OgType": "og-type",
"OgImage": "og-image.jpg",
"OgUrl": "og-url.com"
},
{
"Url": "/demo",
"OgTitle": "og-title2",
"OgType": "og-typ2e",
"OgImage": "og-image2.jpg",
"OgUrl": "og-url2.com"
}
]
}
},
You can configure your options like below in appsettings.json. With v2.0.0 now you can configure your open-graph and twitter card tags as well.
- Add following custom middleware to your
Configure
method in Startup.cs:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
//...
app.UseSeoHelper();
//...
}
If you encounter a problem, you can examine the sample (SeoHelper.Demo) in this repo.
Roadmap
- Version 1
- Meta-tags
- Sitemap.xml
- Robots.txt
- Version 2
- OpenGraph tags (for social media accounts)
- Bug-fixes
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net5.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Configuration (>= 5.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 5.0.0)
- Microsoft.Extensions.DependencyInjection (>= 5.0.1)
- Microsoft.Extensions.Options (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.