@@ -2,31 +2,26 @@ import MetaBar from '@node-core/ui-components/Containers/MetaBar';
22import AvatarGroup from '@node-core/ui-components/Common/AvatarGroup' ;
33import GitHubIcon from '@node-core/ui-components/Icons/Social/GitHub' ;
44
5- import { authors } from '.. /config.json' with { type : 'json' } ;
5+ import { editURL } from '#theme /config' ;
66
7- /**
8- * @typedef MetaBarProps
9- * @property {Array<import('@vcarl/remark-headings').Heading> } headings
10- * @property {string } readingTime
11- * @property {Array<[string, string]> } viewAs
12- * @property {string } editThisPage
13- */
14-
15- /** @param {MetaBarProps } props */
16- export default ( { headings = [ ] , readingTime, viewAs = [ ] , editThisPage } ) => {
17- const pageAuthors = authors [ editThisPage ] ;
7+ /** @param {import('../Layout').Props } props */
8+ export default ( { metadata, headings = [ ] , readingTime } ) => {
9+ const editThisPage = editURL . replace ( '{path}' , metadata . path ) ;
10+ const authors = metadata . authors ?. split ( ',' ) . map ( id => ( {
11+ image : `https://avatars.githubusercontent.com/${ id . trim ( ) } ` ,
12+ url : `https://github.com/${ id . trim ( ) } ` ,
13+ nickname : id ,
14+ } ) ) ;
1815
1916 return (
2017 < MetaBar
2118 heading = "Table of Contents"
2219 headings = { { items : headings } }
2320 items = { {
2421 'Reading Time' : readingTime ,
25- ...( CLIENT && pageAuthors ?. length
22+ ...( CLIENT && authors ?. length
2623 ? {
27- Authors : (
28- < AvatarGroup avatars = { pageAuthors } as = "a" clickable limit = { 5 } />
29- ) ,
24+ Authors : < AvatarGroup avatars = { authors } as = "a" limit = { 5 } /> ,
3025 }
3126 : { } ) ,
3227 Contribute : (
0 commit comments