new logic routes
This commit is contained in:
23
src/components/NewsSingle.astro
Normal file
23
src/components/NewsSingle.astro
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
|
||||
interface Props {
|
||||
post: any;
|
||||
pageInfo?: any;
|
||||
}
|
||||
|
||||
const { post, pageInfo } = Astro.props;
|
||||
|
||||
---
|
||||
|
||||
{post ? (
|
||||
<article class="news-single">
|
||||
<h1>{post.title}</h1>
|
||||
<div class="meta">
|
||||
{post.date && <time>{new Date(post.date).toLocaleDateString('ru-RU')}</time>}
|
||||
</div>
|
||||
{post.content && <div set:html={post.content} />}
|
||||
</article>
|
||||
) : (
|
||||
<div>Новость не найдена</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user