From 00a138fe46d04f5e5cd22a5c513da17993698ae1 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Thu, 25 Jun 2026 13:44:37 +0330 Subject: [PATCH] feat(seo): complete OG/Twitter/structured-data coverage + clean encoding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Blog list (/blog): add robots, full Open Graph + Twitter, Blog + BreadcrumbList JSON-LD, per-page self-canonical, and rel=prev/next for paginated pages. Blog post: add robots, og:site_name, article:published_time / modified_time / author / section, twitter:image, og:image:alt, and a BreadcrumbList JSON-LD (Home → Blog → Category → Post). Gallery (/gallery): add robots, full OG + Twitter (with first image as og:image), ImageGallery + BreadcrumbList JSON-LD. Encoding: register HtmlEncoder.Create(UnicodeRanges.All) so Persian text in meta tags and JSON-LD renders literally instead of &#xXXXX; entities (smaller, cleaner output; friendlier to SEO validators). Co-Authored-By: Claude Opus 4.8 --- DrSousan.Api/Pages/Blog/Index.cshtml | 52 +++++++++++++++++++++++++- DrSousan.Api/Pages/Blog/Post.cshtml | 31 ++++++++++++++- DrSousan.Api/Pages/Gallery.cshtml | 56 +++++++++++++++++++++++++++- DrSousan.Api/Program.cs | 6 +++ 4 files changed, 140 insertions(+), 5 deletions(-) diff --git a/DrSousan.Api/Pages/Blog/Index.cshtml b/DrSousan.Api/Pages/Blog/Index.cshtml index e8991cf..52db0c0 100644 --- a/DrSousan.Api/Pages/Blog/Index.cshtml +++ b/DrSousan.Api/Pages/Blog/Index.cshtml @@ -1,10 +1,58 @@ @page "/blog" @model DrSousan.Api.Pages.Blog.BlogIndexModel +@{ + var blogBase = Environment.GetEnvironmentVariable("SITE_BASE_URL")?.TrimEnd('/') ?? (Request.Scheme + "://" + Request.Host); + var catQs = string.IsNullOrEmpty(Model.ActiveCat) ? "" : "&category=" + Model.ActiveCat; + string PageUrl(int p) => p <= 1 + ? blogBase + "/blog" + (string.IsNullOrEmpty(Model.ActiveCat) ? "" : "?category=" + Model.ActiveCat) + : blogBase + "/blog?pg=" + p + catQs; + var blogDesc = "مقالات تخصصی دکتر سوسن آل‌طه درباره زیبایی پوست، بوتاکس، فیلر، لیزر و مراقبت از پوست."; +} @section Head { @ViewData["Title"] - - + + + + + + @if (Model.CurrentPage > 1) { } + @if (Model.CurrentPage < Model.TotalPages) { } + + + + + + + + + + + + + + + +