Skip to content

Commit fed062f

Browse files
fixign url for jobs
1 parent f3db85b commit fed062f

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/components/jobs/jobCard.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import JobCardCategory from "./jobCardCategory.astro";
55
import dayjs from "dayjs";
66
77
const { job } = Astro.props;
8-
const jobUrl = `/empleos/${job.pubDate}/${job.slug}`;
8+
const jobUrl = `/empleos/${dayjs(job.pubDate).format("DD-MM-YY")}/${job.slug}`;
99
1010
const locationLabel = job.location ? job.location : "Presencial";
1111
const display_date = dayjs(job.pubDate).format("DD/MM/YY");

src/components/jobs/othersJobsCta.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
const { jobs } = Astro.props;
3+
import dayjs from "dayjs";
34
---
45

56
<div
@@ -10,7 +11,7 @@ const { jobs } = Astro.props;
1011
{
1112
jobs.map((job) => (
1213
<li class="w-full py-3">
13-
<a href={`/empleos/${job.pubDate}/${job.slug}`}>
14+
<a href={`/empleos/${dayjs(job.pubDate).format("DD-MM-YY")}/${job.slug}`}>
1415
<div class="font-medium text-base pb-1 text-gray-900 dark:text-gray-100">{job.title}</div>
1516
<div class="text-sm text-gray-600 dark:text-gray-300 line-clamp-1">{job.description.substring(0, 256)}</div>
1617
</a>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function getStaticPaths() {
1212
1313
return allJobs.map((job, index) => {
1414
let nextJobs = allJobs.slice(index + 1, index + 5);
15-
return { params: { slug: `${job.pubDate}/${job.slug}` }, props: { job, nextJobs } };
15+
return { params: { slug: `${dayjs(job.pubDate).format("DD-MM-YY")}/${job.slug}` }, props: { job, nextJobs } };
1616
});
1717
}
1818

0 commit comments

Comments
 (0)