diff --git a/src/JobsMedical.Web/Pages/Index.cshtml b/src/JobsMedical.Web/Pages/Index.cshtml index bead6b6..06aa80a 100644 --- a/src/JobsMedical.Web/Pages/Index.cshtml +++ b/src/JobsMedical.Web/Pages/Index.cshtml @@ -152,3 +152,9 @@ + +@section Head { + @{ var bu = $"{ViewContext.HttpContext.Request.Scheme}://{ViewContext.HttpContext.Request.Host}"; } + @Html.Raw("") + @Html.Raw("") +} diff --git a/src/JobsMedical.Web/Pages/Jobs/Details.cshtml b/src/JobsMedical.Web/Pages/Jobs/Details.cshtml index 74b3a67..fde4abe 100644 --- a/src/JobsMedical.Web/Pages/Jobs/Details.cshtml +++ b/src/JobsMedical.Web/Pages/Jobs/Details.cshtml @@ -177,3 +177,8 @@ { } + +@section Head { + @{ var bu = $"{ViewContext.HttpContext.Request.Scheme}://{ViewContext.HttpContext.Request.Host}"; } + @Html.Raw("") +} diff --git a/src/JobsMedical.Web/Pages/Shared/_Layout.cshtml b/src/JobsMedical.Web/Pages/Shared/_Layout.cshtml index d05c7cd..c0e552f 100644 --- a/src/JobsMedical.Web/Pages/Shared/_Layout.cshtml +++ b/src/JobsMedical.Web/Pages/Shared/_Layout.cshtml @@ -17,14 +17,46 @@ meHasAvatar = info?.HasAvatar ?? false; } var meInitial = string.IsNullOrWhiteSpace(meName) ? "؟" : meName!.Trim().Substring(0, 1); + + // --- SEO context --- + var baseUrl = $"{Context.Request.Scheme}://{Context.Request.Host}"; + var path = Context.Request.Path.Value ?? "/"; + var canonical = baseUrl + (path == "/" ? "" : path); // canonical ignores query string + var pageDesc = ViewData["Description"] as string + ?? "همکادر؛ سامانه یافتن شیفت و موقعیت استخدامی برای کادر درمان (پزشک، پرستار، ماما و تکنسین) در بیمارستان‌ها و کلینیک‌های تهران."; + var pageTitle = title is null ? "همکادر | شیفت و استخدام کادر درمان" : title + " | همکادر"; + var ogImage = ViewData["OgImage"] as string ?? baseUrl + "/icons/icon-512.png"; + // Private/applicant areas must never be indexed. + string[] noindexPrefixes = { "/Admin", "/Me", "/Employer", "/Account", "/Preferences" }; + var noIndex = (ViewData["NoIndex"] as bool? ?? false) + || noindexPrefixes.Any(p => path.StartsWith(p, StringComparison.OrdinalIgnoreCase)); } - @(title is null ? "همکادر | شیفت و استخدام کادر درمان" : title + " | همکادر") - + @pageTitle + + @if (noIndex) + { + + } + else + { + + } + @* Open Graph / Twitter — rich previews when shared in Telegram/Bale/etc. *@ + + + + + + + + + + @* Preload the body-weight font so the swap from Tahoma happens fast. Vazirmatn is self-hosted under wwwroot/fonts (@@font-face in site.css) — no external CDN. *@ @@ -38,6 +70,7 @@ + @await RenderSectionAsync("Head", required: false)