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;
55---
66
77<article
8- data-category ={ post .slug .split (' /' )[0 ]}
8+ data-category ={ post .id .split (' /' )[0 ]}
99 class =" font-light"
1010 aria-hidden =" false"
1111>
Original file line number Diff line number Diff line change @@ -3,11 +3,11 @@ import MarkdownIt from 'markdown-it';
33export function generatePathFromPost ( post , attachBlog = true ) {
44 const postDate = new Date ( post . data . date ) ;
55 return `/${ attachBlog ? 'blog/' : '' } ${
6- post . slug . split ( '/' ) [ 0 ] +
6+ post . id . split ( '/' ) [ 0 ] +
77 '/' +
88 postDate . getFullYear ( ) +
99 '/' +
10- post . slug . split ( '/' ) . pop ( ) . split ( '_' ) . pop ( )
10+ post . id . split ( '/' ) . pop ( ) . split ( '_' ) . pop ( )
1111 } `;
1212}
1313
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export async function getStaticPaths() {
1010 const blogEntries = await getCollection (' blog' );
1111
1212 const filteredEntries = blogEntries .reduce ((groups , entry ) => {
13- const category = entry .slug .split (' /' )[0 ];
13+ const category = entry .id .split (' /' )[0 ];
1414 if (! groups [category ]) {
1515 groups [category ] = {
1616 params: {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export async function getStaticPaths() {
1010 const blogEntries = await getCollection (' blog' );
1111
1212 const filteredEntries = blogEntries .reduce ((groups , entry ) => {
13- const category = entry .slug .split (' /' )[0 ];
13+ const category = entry .id .split (' /' )[0 ];
1414 const postYear = new Date (entry .data .date ).getFullYear ();
1515 if (! groups [category + postYear ]) {
1616 groups [category + postYear ] = {
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ export async function getStaticPaths() {
88 const blogEntries = await getCollection (' blog' );
99 return blogEntries .map ((entry ) => ({
1010 params: {
11- category: entry .slug .split (' /' )[0 ],
11+ category: entry .id .split (' /' )[0 ],
1212 year: new Date (entry .data .date ).getFullYear (),
13- id: entry .slug .split (' /' ).pop ().split (' _' ).pop (),
13+ id: entry .id .split (' /' ).pop ().split (' _' ).pop (),
1414 },
1515 props: { entry },
1616 }));
Original file line number Diff line number Diff line change @@ -422,7 +422,7 @@ import nixosFoundationLogo from '../assets/image/nixos-foundation-logo.svg';
422422 teams .map ((team ) => (
423423 <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" >
424424 <img
425- src = { ` /images/teams/${team .slug .split (' _' )[1 ]}.svg ` }
425+ src = { ` /images/teams/${team .id .split (' _' )[1 ]}.svg ` }
426426 alt = { ` ${team .data .name } Logo ` }
427427 class = " h-24"
428428 />
@@ -432,7 +432,7 @@ import nixosFoundationLogo from '../assets/image/nixos-foundation-logo.svg';
432432 </p >
433433 <Button
434434 color = " green"
435- href = { ' /community/teams/' + team .slug .split (' _' )[1 ]}
435+ href = { ' /community/teams/' + team .id .split (' _' )[1 ]}
436436 >
437437 Read more
438438 </Button >
@@ -461,9 +461,7 @@ import nixosFoundationLogo from '../assets/image/nixos-foundation-logo.svg';
461461 <ul class =" mx-auto mt-2 list-disc pl-8 md:w-72 md:pl-10" >
462462 {
463463 teams
464- .filter (
465- (team ) => team .slug .split (' _' )[1 ] === ' foundation-board' ,
466- )[0 ]
464+ .find ((team ) => team .id .split (' _' )[1 ] === ' foundation-board' )
467465 .data .members .map ((member ) => (
468466 <li class = " mb-1" >
469467 { member .name }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import Layout from '../../../layouts/Layout.astro';
99export async function getStaticPaths() {
1010 const teamEntries = await getCollection (' teams' );
1111 return teamEntries .map ((entry ) => ({
12- params: { slug: entry .slug .split (' _' )[1 ] },
12+ params: { slug: entry .id .split (' _' )[1 ] },
1313 props: { entry },
1414 }));
1515}
Original file line number Diff line number Diff line change 2020 return dateA > dateB ? - 1 : 1 ;
2121 })
2222 .filter ((p ) => {
23- return p .slug .split (' /' )?.[0 ] === ' announcements' ;
23+ return p .id .split (' /' )?.[0 ] === ' announcements' ;
2424 })
2525 .reverse ();
2626---
You can’t perform that action at this time.
0 commit comments