Breadcrumbs: visible trail + BreadcrumbList JSON-LD
Add SeoJsonLd.Breadcrumb + Crumb record + _Breadcrumbs partial, and wire a trail
into the Jobs/Shifts list (landing) and detail pages: خانه › استخدام/شیفت › {نقش}
› {شهر|عنوان}. The role crumb links to the role landing page (more internal
links), and Google can show the breadcrumb path in results. Detail pages emit it
alongside the existing JobPosting JSON-LD.
Improvement 5 of the backlog (SEO).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -23,10 +23,14 @@
|
||||
if (j.SalaryMin is null && j.SalaryMax is null) salary = "توافقی";
|
||||
else if (j.SalaryMin == j.SalaryMax) salary = JalaliDate.Toman(j.SalaryMin) + " ماهانه";
|
||||
else salary = $"از {JalaliDate.ToPersianDigits((j.SalaryMin ?? 0).ToString("#,0"))} تا {JalaliDate.Toman(j.SalaryMax)} ماهانه";
|
||||
var crumbs = new List<JobsMedical.Web.Services.Crumb> { new("خانه", "/"), new("استخدام", "/Jobs") };
|
||||
if (j.Role is not null) crumbs.Add(new(j.Role.Name, "/استخدام/" + JobsMedical.Web.Services.SeoSlug.Of(j.Role.Name)));
|
||||
crumbs.Add(new(j.Title, null));
|
||||
}
|
||||
|
||||
<div class="page-head">
|
||||
<div class="container">
|
||||
<partial name="_Breadcrumbs" model="crumbs" />
|
||||
<div class="row" style="display:flex; gap:10px; align-items:center;">
|
||||
<span class="badge badge-job">@empLabel</span>
|
||||
@if (j.Role is not null) { <span class="badge badge-type">@j.Role.Name</span> }
|
||||
@@ -199,9 +203,10 @@
|
||||
@section Head {
|
||||
@* Only emit JobPosting structured data for a real named employer — Google for Jobs rejects a
|
||||
placeholder/empty hiringOrganization (most aggregated ads have no named center). *@
|
||||
@{ var bu = $"{ViewContext.HttpContext.Request.Scheme}://{ViewContext.HttpContext.Request.Host}"; }
|
||||
@Html.Raw("<script type=\"application/ld+json\">" + JobsMedical.Web.Services.SeoJsonLd.Breadcrumb(crumbs, bu) + "</script>")
|
||||
@if (JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(f))
|
||||
{
|
||||
var bu = $"{ViewContext.HttpContext.Request.Scheme}://{ViewContext.HttpContext.Request.Host}";
|
||||
@Html.Raw("<script type=\"application/ld+json\">" + JobsMedical.Web.Services.SeoJsonLd.JobPosting(j, bu) + "</script>")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user