{"id":26673702,"url":"https://github.com/mjebrahimi/seotags","last_synced_at":"2025-05-16T07:05:33.983Z","repository":{"id":37887858,"uuid":"382632683","full_name":"mjebrahimi/SeoTags","owner":"mjebrahimi","description":"🚀 SeoTags generates All SEO Tags you need such as meta, link, Twitter card (twitter:), Open Graph (for Facebook) (og:), and JSON-LD schema (structured data).","archived":false,"fork":false,"pushed_at":"2025-04-19T23:20:32.000Z","size":939,"stargazers_count":163,"open_issues_count":0,"forks_count":18,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-19T23:27:36.338Z","etag":null,"topics":["asp-net-core","asp-net-core-mvc","aspnet-core","aspnetcore","json-ld","jsonld","metatags","open-graph","opengraph","opengraph-tags","seo","seo-friendly","seo-meta","seo-optimization","seo-plugin","seo-tags","seo-tools","seotools","twitter-card","twitter-cards"],"latest_commit_sha":null,"homepage":"https://mjebrahimi.github.io/SeoTags/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjebrahimi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-07-03T14:16:11.000Z","updated_at":"2025-04-19T22:57:34.000Z","dependencies_parsed_at":"2023-02-08T21:15:39.978Z","dependency_job_id":"e711e2c6-0cbd-48eb-80c0-21286c4f6864","html_url":"https://github.com/mjebrahimi/SeoTags","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjebrahimi%2FSeoTags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjebrahimi%2FSeoTags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjebrahimi%2FSeoTags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjebrahimi%2FSeoTags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjebrahimi","download_url":"https://codeload.github.com/mjebrahimi/SeoTags/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485062,"owners_count":22078767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net-core","asp-net-core-mvc","aspnet-core","aspnetcore","json-ld","jsonld","metatags","open-graph","opengraph","opengraph-tags","seo","seo-friendly","seo-meta","seo-optimization","seo-plugin","seo-tags","seo-tools","seotools","twitter-card","twitter-cards"],"created_at":"2025-03-26T01:37:24.043Z","updated_at":"2025-05-16T07:05:28.938Z","avatar_url":"https://github.com/mjebrahimi.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NuGet](https://img.shields.io/nuget/dt/SeoTags?style=flat\u0026logo=nuget\u0026cacheSeconds=1\u0026label=Downloads)](https://www.nuget.org/packages/SeoTags)\n[![NuGet](https://img.shields.io/nuget/v/SeoTags.svg)](https://www.nuget.org/packages/SeoTags)\n[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n[![Build Status](https://github.com/mjebrahimi/SeoTags/workflows/.NET/badge.svg)](https://github.com/mjebrahimi/SeoTags)\n\n# SeoTags\nSeoTags generates **All SEO Tags** you need such as **meta**, **link**, **Twitter card** (twitter:), **Open Graph (for Facebook)** (og:), and **JSON-LD** schema (structured data).\n\n## How to use\n\nSee https://mjebrahimi.github.io/SeoTags/ for more info.\n\n### 1. Install Package\n\n```ini\nPM\u003e Install-Package SeoTags\n```\n\n### 2. Register/Configure to your Services\n\nEverything you need to do is to configure the `SeoInfo` object and render it in your `_Layout.cshtml`.\n\nThis configuring can be done by setting the properties of the `SeoInfo` object in **three ways**:\n\n1. When **registering your services** using `services.AddSeoTags(seoInfo =\u003e { ... })` method.\n2. `Html.SetSeoInfo(seoInfo =\u003e { ... })` method in your `.cshtml` **views (Mvc or RazorPages)**\n3. `HttpContext.SetSeoInfo(seoInfo =\u003e { ... })` method anywhere you access the `HttpContext` object (for example in your mvc **Controller**/**Action** or razor-pages **PageModel**)\n\nThere are general options that are constant for your entire website (not specific to a certain page), such as **Website Title**, **Twitter ID**, **Facebook ID**, **OpenSearch URL**, **feeds (RSS or Atom)**, etc...\n\nUsually, these values are set when registering services using `services.AddSeoTags(seoInfo =\u003e { ... })` method.\n\n```cs\n//Register your services\napp.Services.AddSeoTags(seoInfo =\u003e\n{\n    seoInfo.SetSiteInfo(\n        siteTitle: \"My Site Title\", \n        siteTwitterId: \"@MySiteTwitter\",                    //Optional\n        siteFacebookId: \"https://facebook.com/MySite\",      //Optional\n        openSearchUrl: \"https://site.com/open-search.xml\",  //Optional\n        robots: \"index, follow\"                             //Optional\n    );\n\n    //Optional\n    seoInfo.AddFeed(\n        title: \"Post Feeds\",\n        url: \"https://site.com/rss/\",\n        feedType: FeedType.Rss);\n\n    //Optional\n    seoInfo.AddDnsPrefetch(\"https://fonts.gstatic.com/\", \"https://www.google-analytics.com\");\n\n    //Optional\n    seoInfo.AddPreload(new Preload(\"https://site.com/site.css\"),\n        new Preload(\"https://site.com/app.js\"),\n        new Preload(\"https://site.com/fonts/Font.woff2\"),\n        new Preload(\"https://site.com/fonts/Font_Light.woff2\"),\n        new Preload(\"https://site.com/fonts/Font_Medium.woff2\"),\n        new Preload(\"https://site.com/fonts/Font_Bold.woff2\"));\n\n    //Optional\n    seoInfo.SetLocales(\"en_US\");\n});\n//...\n```\n\n### 3. Render SEO Tags in your _Layout.cshtml\n\nTo render the output SEO Tags call `Html.SeoTags()` method in your `_Layout.cshtml`.\n\nThis method has two overloads, one with a `SeoInfo` argument (if you need to pass a new arbitrary instance of the `SeoInfo` object), and one without an argument that retrieves the configured `SeoInfo` object from your previous registered services.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003c!-- Remove these tags from your _Layout.cshtml\n    \u003cmeta charset=\"utf-8\" /\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /\u003e\n    \u003ctitle\u003e@ViewData[\"Title\"] -  Site Title\u003c/title\u003e\n    --\u003e\n\n    \u003c!-- SeoTags generates all of these for you --\u003e\n    @Html.SeoTags() \u003c!-- 👈 Add this line --\u003e\n```\n\n### 4. Set Specific SEO info in your Views/Pages\n\nThere are some specific SEO info that you may want to set for a certain page, such as such as **Page Title**, **Page Description**, **Page Keywords**, **Page URL**, **Publish Date**, **Modified Date**, **Image Info**, **Page Type** etc...\n\nTo do this, call `Html.SetSeoInfo(seoInfo =\u003e { ... })` method in your `.cshtml` views to set specific desired SEO info for that page.\n\nYou can do the same by calling `HttpContext.SetSeoInfo(seoInfo =\u003e { ... })` anywhere you access to `HttpContext` object (for example in your mvc **Controller**/**Action** or razor-pages **PageModel**)\n\n```csharp\n@{\n    // Remove these line from your views\n    // ViewData[\"Title\"] = \"Page Title\";\n\n    Html.SetSeoInfo(seoInfo =\u003e\n    {\n        seoInfo.SetCommonInfo(\n            pageTitle: \"SEO Tags for ASP.NET Core\",\n            description: \"SetoTags creates all SEO tags you need such as meta, link, Twitter card (twitter:), open graph (og:), and ...\",\n            url: \"https://site.com/url/\",\n            keywordTags: new[] { \"SEO\", \"AspNetCore\", \"MVC\", \"RazorPages\" }, //Optional\n            seeAlsoUrls: new[] { \"https://site.com/see-also-1\", \"https://site.com/see-also-2\" }  //Optional\n        );\n\n        seoInfo.SetImageInfo(\n            url: \"https://site.com/uploads/image.jpg\",\n            width: 1280,                                        //Optional\n            height: 720,                                        //Optional\n            alt: \"Image alt\",                                   //Optional\n            //mimeType: \"image/jpeg\",                           //Optional (detects from URL file extension if not set.)\n            cardType: SeoTags.TwitterCardType.SummaryLargeImage //Optional\n        );\n\n        seoInfo.SetArticleInfo(\n            authorName: \"Author Name\",\n            publishDate: DateTimeOffset.Now,\n            modifiedDate: DateTimeOffset.Now,                   //Optional\n            authorTwitterId: \"@MyTwitterId\",                    //Optional\n            authorFacebookId: \"https://facebook.com/MyUserId\",  //Optional\n            authorUrl: \"https://github.com/author-profile\",     //Optional\n            section: \"Article Topic\"                            //Optional\n        );\n\n        //Add another RSS feed. (only for this page) (Optional)\n        seoInfo.AddFeed(\"Post Comments\", \"https://site.com/post/comment/rss\", SeoTags.FeedType.Rss);\n    });\n}\n```\n\n### 5. Done! Enjoy the Renderd Output\n\nOpen your page in a browser and view the source code.\n\nThe following code shows the rendered output for this example.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n\n\u003cmeta charset=\"utf-8\" /\u003e\n\u003cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /\u003e\n\u003cmeta http-equiv=\"X-UA-Compatible\" content=\"IE=edge, chrome=1\" /\u003e\n\u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\" /\u003e\n\n\u003clink rel=\"preconnect\" href=\"https://fonts.gstatic.com/\" crossorigin /\u003e\n\u003clink rel=\"preconnect\" href=\"https://www.google-analytics.com\" crossorigin /\u003e\n\u003clink rel=\"dns-prefetch\" href=\"https://fonts.gstatic.com/\" /\u003e\n\u003clink rel=\"dns-prefetch\" href=\"https://www.google-analytics.com\" /\u003e\n\u003clink rel=\"preload\" as=\"style\" href=\"https://site.com/site.css\" /\u003e\n\u003clink rel=\"preload\" as=\"script\" href=\"https://site.com/app.js\" /\u003e\n\u003clink rel=\"preload\" as=\"font\" type=\"font/woff2\" href=\"https://site.com/fonts/Font.woff2\" crossorigin /\u003e\n\u003clink rel=\"preload\" as=\"font\" type=\"font/woff2\" href=\"https://site.com/fonts/Font_Light.woff2\" crossorigin /\u003e\n\u003clink rel=\"preload\" as=\"font\" type=\"font/woff2\" href=\"https://site.com/fonts/Font_Medium.woff2\" crossorigin /\u003e\n\u003clink rel=\"preload\" as=\"font\" type=\"font/woff2\" href=\"https://site.com/fonts/Font_Bold.woff2\" crossorigin /\u003e\n\u003clink rel=\"preload\" as=\"image\" type=\"image/jpeg\" href=\"https://site.com/uploads/image.jpg\" /\u003e\n\n\u003ctitle\u003eSEO Tags for ASP.NET Core - My Site Title\u003c/title\u003e\n\u003cmeta name=\"title\" content=\"SEO Tags for ASP.NET Core - My Site Title\" /\u003e\n\u003cmeta name=\"description\" content=\"SetoTags Creates all SEO tags you need such as meta, link, Twitter card (twitter:), open graph (og:), and ...\" /\u003e\n\u003cmeta name=\"keywords\" content=\"SEO, AspNetCore, MVC, RazorPages\" /\u003e\n\u003cmeta name=\"author\" content=\"Author Name\" /\u003e\n\u003clink rel=\"author\" href=\"https://github.com/author-profile\" /\u003e\n\u003clink rel=\"canonical\" href=\"https://site.com/url/\" /\u003e\n\u003clink rel=\"application/opensearchdescription+xml\" title=\"My Site Title\" href=\"https://site.com/open-search.xml\" /\u003e\n\u003clink rel=\"alternate\" type=\"application/rss+xml\" title=\"Post Feeds\" href=\"https://site.com/rss/\" /\u003e\n\u003clink rel=\"alternate\" type=\"application/rss+xml\" title=\"Post Comments\" href=\"https://site.com/post/comment/rss\" /\u003e\n\n\u003cmeta name=\"twitter:card\" content=\"summary_large_image\" /\u003e\n\u003cmeta name=\"twitter:title\" content=\"SEO Tags for ASP.NET Core\" /\u003e\n\u003cmeta name=\"twitter:description\" content=\"SetoTags creates all SEO tags you need such as meta, link, Twitter card (twitter:), open graph (og:), and ...\" /\u003e\n\u003cmeta name=\"twitter:site\" content=\"@MySiteTwitter\" /\u003e\n\u003cmeta name=\"twitter:creator\" content=\"@MyTwitterId\" /\u003e\n\u003cmeta name=\"twitter:image\" content=\"https://site.com/uploads/image.jpg\" /\u003e\n\u003cmeta name=\"twitter:image:width\" content=\"1280\" /\u003e\n\u003cmeta name=\"twitter:image:height\" content=\"720\" /\u003e\n\u003cmeta name=\"twitter:image:alt\" content=\"Image alt\" /\u003e\n\n\u003cmeta property=\"og:type\" content=\"article\" /\u003e\n\u003cmeta property=\"og:title\" content=\"SEO Tags for ASP.NET Core\" /\u003e\n\u003cmeta property=\"og:description\" content=\"SetoTags creates all SEO tags you need such as meta, link, Twitter card (twitter:), open graph (og:), and ...\" /\u003e\n\u003cmeta property=\"og:url\" content=\"https://site.com/url/\" /\u003e\n\u003cmeta property=\"og:site_name\" content=\"My Site Title\" /\u003e\n\u003cmeta property=\"og:locale\" content=\"en_US\" /\u003e\n\u003cmeta property=\"og:image\" content=\"https://site.com/uploads/image.jpg\" /\u003e\n\u003cmeta property=\"og:image:secure_url\" content=\"https://site.com/uploads/image.jpg\" /\u003e\n\u003cmeta property=\"og:image:type\" content=\"image/jpeg\" /\u003e\n\u003cmeta property=\"og:image:width\" content=\"1280\" /\u003e\n\u003cmeta property=\"og:image:height\" content=\"720\" /\u003e\n\u003cmeta property=\"og:image:alt\" content=\"Image alt\" /\u003e\n\u003cmeta property=\"article:publisher\" content=\"https://facebook.com/MySite\" /\u003e\n\u003cmeta property=\"article:author\" content=\"https://facebook.com/MyUserId\" /\u003e\n\u003cmeta property=\"article:published_time\" content=\"2021-07-03T13:34:41+00:00\" /\u003e\n\u003cmeta property=\"article:modified_time\" content=\"2021-07-03T13:34:41+00:00\" /\u003e\n\u003cmeta property=\"article:section\" content=\"Article Topic\" /\u003e\n\u003cmeta property=\"article:tag\" content=\"SEO\" /\u003e\n\u003cmeta property=\"article:tag\" content=\"AspNetCore\" /\u003e\n\u003cmeta property=\"article:tag\" content=\"MVC\" /\u003e\n\u003cmeta property=\"article:tag\" content=\"RazorPages\" /\u003e\n\u003cmeta property=\"og:see_also\" content=\"https://site.com/see-also-1\" /\u003e\n\u003cmeta property=\"og:see_also\" content=\"https://site.com/see-also-2\" /\u003e\n\n...\n```\n\n## JSON-LD Support\n\nSeoTags now supports popular JSON-LD types such as **Article**, **Product**, **Book**, **Organization**, **WebSite**, **WebPage**, and etc...\n\nSee our docs for [Nested example](https://mjebrahimi.github.io/SeoTags/jsonld1.html) and [Referenced example](https://mjebrahimi.github.io/SeoTags/jsonld2.html).\n\n## Note\n- This package does not generate **favicon** tags. Use [realfavicongenerator.net](https://realfavicongenerator.net/) to generate favicon tags. \n- **Only ASP.NET Core is supported** (not the legacy ASP.NET Framework)\n\n## Contributing\n\nCreate an [issue](https://github.com/mjebrahimi/SeoTags/issues/new) if you find a BUG or have a Suggestion or Question. If you want to develop this project :\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request\n\n## Give a Star! ⭐️\n\nIf you find this repository useful, please give it a star. Thanks!\n\n## License\n\nCopyright © 2021 [Mohammd Javad Ebrahimi](https://github.com/mjebrahimi) under the [MIT License](https://github.com/mjebrahimi/SeoTags/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjebrahimi%2Fseotags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjebrahimi%2Fseotags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjebrahimi%2Fseotags/lists"}