diff --git a/src/components/ArticleItem/ArticleItem.tsx b/src/components/ArticleItem/ArticleItem.tsx index 850443d..b120858 100644 --- a/src/components/ArticleItem/ArticleItem.tsx +++ b/src/components/ArticleItem/ArticleItem.tsx @@ -6,16 +6,19 @@ import "./ArticleItem.scss"; export type ArticleItemProps = { id: number; title: string; - pubDate: Date; + pubDate: string; pageLang: string; + articleLang: string; + slug: string; }; const ArticleItem: Component = (props) => { const articleLang = "ru"; - // const href = createRelativeArticleUrl( - // { id: props.id, title: props.title, pubDate: props.pubDate }, - // URL_BLOG_PREFIX - // ); + + const href = createRelativeArticleUrl( + { pubDate: props.pubDate, slug: props.slug, articleLang: props.articleLang }, + URL_BLOG_PREFIX + ); return (
= (props) => { itemtype="http://schema.org/BlogPosting" class="article-item" > - +

{props.title}

{articleLang !== props.pageLang && {articleLang.toLocaleUpperCase()}}

-

diff --git a/src/components/ArticlesList/ArticlesList.tsx b/src/components/ArticlesList/ArticlesList.tsx index c0bb5a5..b864057 100644 --- a/src/components/ArticlesList/ArticlesList.tsx +++ b/src/components/ArticlesList/ArticlesList.tsx @@ -75,7 +75,7 @@ const ArticlesList: Component = (props) => { {(year) => (

{year}

- + {/* {({ id, title, pubDate }) => ( = (props) => { pageLang={props.pageLang} /> )} - + */}
)} diff --git a/src/components/AvailableOnLangs.astro b/src/components/AvailableOnLangs.astro index 62d5ccd..a665b46 100644 --- a/src/components/AvailableOnLangs.astro +++ b/src/components/AvailableOnLangs.astro @@ -21,15 +21,13 @@ const { articles } = Astro.props; {articles .filter((a) => !a.id.startsWith(`${pageLang}/`)) .map(({ id, data: { title, pubDate } }) => ( - {`${ - languages[id.split("/")[0] as LanguageKeys] - }`} + {`${languages[id.split("/")[0] as LanguageKeys]}`} ))} ) } -