feat: implement SEO enhancements and sitemap generation
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled

- Added SEO configuration settings in appsettings for both development and staging environments, including site URL, name, and default description.
- Registered SEO-related services in the dependency injection container, including `SeoMetadataProvider` and `SitemapGenerator`.
- Updated the main program to configure SEO settings and map a new endpoint for generating the sitemap.
- Enhanced the `_Host.cshtml` page to utilize SEO metadata, including title, description, and Open Graph tags, improving search engine visibility and user engagement.

These changes significantly enhance the SEO capabilities of the application, ensuring better indexing and presentation in search results.
This commit is contained in:
masoodafar-web
2026-07-01 21:45:24 +03:30
parent 5d58d354d7
commit 2573729db5
11 changed files with 390 additions and 0 deletions
+39
View File
@@ -1,4 +1,5 @@
@page "/"
@model FrontOffice.Main.Pages.HostModel
@using Microsoft.AspNetCore.Components.Web
@namespace FrontOffice.Main.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@@ -8,6 +9,26 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@Model.Seo.Title</title>
<meta name="description" content="@Model.Seo.Description" />
<link rel="canonical" href="@Model.Seo.CanonicalUrl" />
@if (Model.Seo.NoIndex)
{
<meta name="robots" content="noindex, nofollow" />
}
else
{
<meta name="robots" content="index, follow" />
}
<meta property="og:type" content="website" />
<meta property="og:locale" content="fa_IR" />
<meta property="og:title" content="@Model.Seo.Title" />
<meta property="og:description" content="@Model.Seo.Description" />
<meta property="og:url" content="@Model.Seo.CanonicalUrl" />
<meta property="og:site_name" content="کارابازار سلامت" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="@Model.Seo.Title" />
<meta name="twitter:description" content="@Model.Seo.Description" />
<meta name="theme-color" content="#7c4dff" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
@@ -23,8 +44,26 @@
<link href="FrontOffice.Main.styles.css" rel="stylesheet" />
<!-- d3-org-chart custom styles -->
<link href="css/org-chart.css" rel="stylesheet" asp-append-version="true" />
<style>
.seo-crawlable {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
</style>
</head>
<body>
@if (!string.IsNullOrWhiteSpace(Model.Seo.CrawlableContent))
{
<div class="seo-crawlable">@Model.Seo.CrawlableContent</div>
}
<component type="typeof(App)" render-mode="Server" />
<div id="blazor-error-ui">