|
@@ -1,25 +1,16 @@
|
|
|
---
|
|
|
import Icon from "../../lib/Icon.astro"
|
|
|
-import type { MarkdownInstance } from "astro"
|
|
|
import FormatHTML from "../../lib/FormatHTML.astro"
|
|
|
import { createDocument } from "../../utils"
|
|
|
+import type { Project as ProjectType } from "../../api/projects"
|
|
|
|
|
|
export interface Props {
|
|
|
- project: MarkdownInstance<{
|
|
|
- link: string
|
|
|
- title: string
|
|
|
- links: Array<{
|
|
|
- href: string
|
|
|
- title: string
|
|
|
- icon: string
|
|
|
- }>
|
|
|
- color?: string
|
|
|
- }>
|
|
|
+ project: ProjectType
|
|
|
}
|
|
|
|
|
|
const { project } = Astro.props
|
|
|
const {
|
|
|
- frontmatter: { link, title, links, color },
|
|
|
+ frontmatter: { link, title, links, color, time },
|
|
|
} = project
|
|
|
|
|
|
const html = project.compiledContent()
|
|
@@ -30,15 +21,18 @@ const techs = document.getElementsByTagName("ul").pop()?.outerHTML
|
|
|
---
|
|
|
|
|
|
<div class="project" style={{ "--color": color }}>
|
|
|
- <div class="project__title">
|
|
|
- <h3>
|
|
|
- {title}
|
|
|
- <a
|
|
|
- href={link}
|
|
|
- target="blank"
|
|
|
- class="project__link"
|
|
|
- aria-label=`Перейти на ${title}`></a>
|
|
|
- </h3>
|
|
|
+ <div class="project__header">
|
|
|
+ <div class="project__title">
|
|
|
+ <h3>
|
|
|
+ {title}
|
|
|
+ <a
|
|
|
+ href={link}
|
|
|
+ target="blank"
|
|
|
+ class="project__link"
|
|
|
+ aria-label=`Перейти на ${title}`></a>
|
|
|
+ </h3>
|
|
|
+ {time && <div class="project__time">{time}</div>}
|
|
|
+ </div>
|
|
|
<ul class="links">
|
|
|
{
|
|
|
links.map(({ href, title, icon }) => (
|
|
@@ -78,7 +72,7 @@ const techs = document.getElementsByTagName("ul").pop()?.outerHTML
|
|
|
margin: 0;
|
|
|
}
|
|
|
|
|
|
- .project__title {
|
|
|
+ .project__header {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
}
|