mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-11 18:39:14 +03:00
changed article url
This commit is contained in:
parent
d935483507
commit
487b7e2add
@ -9,7 +9,7 @@ export type ArticleItemProps = {
|
|||||||
export const ArticleItem: Component<ArticleItemProps> = (props) => {
|
export const ArticleItem: Component<ArticleItemProps> = (props) => {
|
||||||
return (
|
return (
|
||||||
<article class="article-item">
|
<article class="article-item">
|
||||||
<a href={`/${new Date(props.data.published_at).toLocaleDateString('en-CA')}/${props.data.slug}`}>
|
<a href={`/blog/${new Date(props.data.published_at).toLocaleDateString('en-CA')}/${props.data.slug}`}>
|
||||||
<h3>{props.data.title}</h3>
|
<h3>{props.data.title}</h3>
|
||||||
<p>
|
<p>
|
||||||
<time datetime={props.data.published_at.toString()}>{DateFormatter.format(new Date(props.data.published_at))}</time>
|
<time datetime={props.data.published_at.toString()}>{DateFormatter.format(new Date(props.data.published_at))}</time>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import ArticleLayout from '@root/layouts/article.astro';
|
|||||||
|
|
||||||
// TODO: generate pages based on user language
|
// TODO: generate pages based on user language
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const data = await Astro.glob<ArticleType>('../../content/articles/**/*.md');
|
const data = await Astro.glob<ArticleType>('../../../content/articles/**/*.md');
|
||||||
return data.map((article) => {
|
return data.map((article) => {
|
||||||
const published_at = new Date(article.frontmatter.published_at).toLocaleDateString('en-CA');
|
const published_at = new Date(article.frontmatter.published_at).toLocaleDateString('en-CA');
|
||||||
const slug = `${published_at}/${article.frontmatter.slug}`;
|
const slug = `${published_at}/${article.frontmatter.slug}`;
|
||||||
@ -19,7 +19,7 @@ const articles = utils.transformArticles(data);
|
|||||||
</SplashHeading>
|
</SplashHeading>
|
||||||
<SplashLinks>
|
<SplashLinks>
|
||||||
<Link icon='information' href='/about'>обо мне</Link>
|
<Link icon='information' href='/about'>обо мне</Link>
|
||||||
<Link icon='email_filled' href='/about'>написать мне</Link>
|
<Link icon='email_filled' href='/contacts'>написать мне</Link>
|
||||||
</SplashLinks>
|
</SplashLinks>
|
||||||
</Splash>
|
</Splash>
|
||||||
<RecentArticles articles={articles} length={4} />
|
<RecentArticles articles={articles} length={4} />
|
||||||
|
|||||||
@ -80,7 +80,7 @@
|
|||||||
--border-radius-lg: 5px;
|
--border-radius-lg: 5px;
|
||||||
|
|
||||||
/* Sizes */
|
/* Sizes */
|
||||||
--content-width: 760px;
|
--content-width: 820px;
|
||||||
--content-padding: 24px;
|
--content-padding: 24px;
|
||||||
|
|
||||||
--opacity-hover: 0.7;
|
--opacity-hover: 0.7;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user