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:
@@ -21,10 +21,14 @@
|
||||
ShiftType.Night => ("badge-night", "شیفت شب"),
|
||||
_ => ("badge-oncall", "آنکال"),
|
||||
};
|
||||
var crumbs = new List<JobsMedical.Web.Services.Crumb> { new("خانه", "/"), new("شیفتها", "/Shifts") };
|
||||
if (s.Role is not null) crumbs.Add(new(s.Role.Name, "/شیفت/" + JobsMedical.Web.Services.SeoSlug.Of(s.Role.Name)));
|
||||
crumbs.Add(new(JobsMedical.Web.Services.SeoJsonLd.HasRealEmployer(f) ? f.Name : "جزئیات شیفت", 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 @badgeClass">@typeLabel</span>
|
||||
@if (f.IsVerified)
|
||||
@@ -216,10 +220,11 @@
|
||||
}
|
||||
|
||||
@section Head {
|
||||
@{ 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>")
|
||||
@* Only for a real named employer — Google for Jobs rejects a placeholder hiringOrganization. *@
|
||||
@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.ShiftPosting(s, bu) + "</script>")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user