Skip to content

Commit bdc01bf

Browse files
fixing bug in job title generation
1 parent 71b60a7 commit bdc01bf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/pages/empleos/[...slug].astro

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ if (job.organization) {
5050
}
5151
}
5252
53-
let jobTitle = job.categories.map((category) => profileCategories[category].text).join(", ");
5453
let jobType;
5554
5655
if (job.fulltime) {
@@ -66,7 +65,15 @@ if (job.freelance) {
6665
jobType = "Freelance";
6766
}
6867
69-
seoSchema["title"] = jobType ? jobType + " " + jobTitle : jobTitle;
68+
let jobTitle = job.title;
69+
70+
if (job.categories) {
71+
jobTitle = job.categories.map((category) => profileCategories[category].text).join(", ");
72+
if (jobType) {
73+
jobTitle = jobType + " " + jobTitle;
74+
}
75+
}
76+
seoSchema["title"] = jobTitle;
7077
---
7178

7279
<BaseLayout title={`${job.title} | CuCoders Jobs`} seoSchema={seoSchema} description={job.description.slice(0, 180)}>

0 commit comments

Comments
 (0)