File tree Expand file tree Collapse file tree 8 files changed +12
-14
lines changed Expand file tree Collapse file tree 8 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const { post } = Astro.props;
5
5
---
6
6
7
7
<article
8
- data-category ={ post .slug .split (' /' )[0 ]}
8
+ data-category ={ post .id .split (' /' )[0 ]}
9
9
class =" font-light"
10
10
aria-hidden =" false"
11
11
>
Original file line number Diff line number Diff line change @@ -3,11 +3,11 @@ import MarkdownIt from 'markdown-it';
3
3
export function generatePathFromPost ( post , attachBlog = true ) {
4
4
const postDate = new Date ( post . data . date ) ;
5
5
return `/${ attachBlog ? 'blog/' : '' } ${
6
- post . slug . split ( '/' ) [ 0 ] +
6
+ post . id . split ( '/' ) [ 0 ] +
7
7
'/' +
8
8
postDate . getFullYear ( ) +
9
9
'/' +
10
- post . slug . split ( '/' ) . pop ( ) . split ( '_' ) . pop ( )
10
+ post . id . split ( '/' ) . pop ( ) . split ( '_' ) . pop ( )
11
11
} `;
12
12
}
13
13
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export async function getStaticPaths() {
10
10
const blogEntries = await getCollection (' blog' );
11
11
12
12
const filteredEntries = blogEntries .reduce ((groups , entry ) => {
13
- const category = entry .slug .split (' /' )[0 ];
13
+ const category = entry .id .split (' /' )[0 ];
14
14
if (! groups [category ]) {
15
15
groups [category ] = {
16
16
params: {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export async function getStaticPaths() {
10
10
const blogEntries = await getCollection (' blog' );
11
11
12
12
const filteredEntries = blogEntries .reduce ((groups , entry ) => {
13
- const category = entry .slug .split (' /' )[0 ];
13
+ const category = entry .id .split (' /' )[0 ];
14
14
const postYear = new Date (entry .data .date ).getFullYear ();
15
15
if (! groups [category + postYear ]) {
16
16
groups [category + postYear ] = {
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ export async function getStaticPaths() {
8
8
const blogEntries = await getCollection (' blog' );
9
9
return blogEntries .map ((entry ) => ({
10
10
params: {
11
- category: entry .slug .split (' /' )[0 ],
11
+ category: entry .id .split (' /' )[0 ],
12
12
year: new Date (entry .data .date ).getFullYear (),
13
- id: entry .slug .split (' /' ).pop ().split (' _' ).pop (),
13
+ id: entry .id .split (' /' ).pop ().split (' _' ).pop (),
14
14
},
15
15
props: { entry },
16
16
}));
Original file line number Diff line number Diff line change @@ -422,7 +422,7 @@ import nixosFoundationLogo from '../assets/image/nixos-foundation-logo.svg';
422
422
teams .map ((team ) => (
423
423
<li class = " flex grow basis-72 flex-col items-center gap-2 text-center text-white md:items-start md:text-left [&>a]:inline-block" >
424
424
<img
425
- src = { ` /images/teams/${team .slug .split (' _' )[1 ]}.svg ` }
425
+ src = { ` /images/teams/${team .id .split (' _' )[1 ]}.svg ` }
426
426
alt = { ` ${team .data .name } Logo ` }
427
427
class = " h-24"
428
428
/>
@@ -432,7 +432,7 @@ import nixosFoundationLogo from '../assets/image/nixos-foundation-logo.svg';
432
432
</p >
433
433
<Button
434
434
color = " green"
435
- href = { ' /community/teams/' + team .slug .split (' _' )[1 ]}
435
+ href = { ' /community/teams/' + team .id .split (' _' )[1 ]}
436
436
>
437
437
Read more
438
438
</Button >
@@ -461,9 +461,7 @@ import nixosFoundationLogo from '../assets/image/nixos-foundation-logo.svg';
461
461
<ul class =" mx-auto mt-2 list-disc pl-8 md:w-72 md:pl-10" >
462
462
{
463
463
teams
464
- .filter (
465
- (team ) => team .slug .split (' _' )[1 ] === ' foundation-board' ,
466
- )[0 ]
464
+ .find ((team ) => team .id .split (' _' )[1 ] === ' foundation-board' )
467
465
.data .members .map ((member ) => (
468
466
<li class = " mb-1" >
469
467
{ member .name }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import Layout from '../../../layouts/Layout.astro';
9
9
export async function getStaticPaths() {
10
10
const teamEntries = await getCollection (' teams' );
11
11
return teamEntries .map ((entry ) => ({
12
- params: { slug: entry .slug .split (' _' )[1 ] },
12
+ params: { slug: entry .id .split (' _' )[1 ] },
13
13
props: { entry },
14
14
}));
15
15
}
Original file line number Diff line number Diff line change 20
20
return dateA > dateB ? - 1 : 1 ;
21
21
})
22
22
.filter ((p ) => {
23
- return p .slug .split (' /' )?.[0 ] === ' announcements' ;
23
+ return p .id .split (' /' )?.[0 ] === ' announcements' ;
24
24
})
25
25
.reverse ();
26
26
---
You can’t perform that action at this time.
0 commit comments