Use repository link for projects
All checks were successful
Deploy Astro / Build and Deploy (push) Successful in 49s
All checks were successful
Deploy Astro / Build and Deploy (push) Successful in 49s
This commit is contained in:
@@ -17,6 +17,7 @@ const portfolioCollection = defineCollection({
|
|||||||
summary: z.string(),
|
summary: z.string(),
|
||||||
tags: z.array(z.string()).optional(),
|
tags: z.array(z.string()).optional(),
|
||||||
pubDate: z.date(),
|
pubDate: z.date(),
|
||||||
|
repository: z.url().regex(/git/).optional(),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
import { getCollection, render } from 'astro:content';
|
import { getCollection, render } from 'astro:content';
|
||||||
|
import { Icon } from "astro-icon/components";
|
||||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||||
import "katex/dist/katex.min.css";
|
import "katex/dist/katex.min.css";
|
||||||
import "rehype-callouts/theme/obsidian"
|
import "rehype-callouts/theme/obsidian"
|
||||||
@@ -18,11 +19,23 @@ const { Content } = await render(entry);
|
|||||||
<div class="glass-container header" style={`view-transition-name: project-header-${entry.id};`}>
|
<div class="glass-container header" style={`view-transition-name: project-header-${entry.id};`}>
|
||||||
<h1 style={`view-transition-name: project-headline-${entry.id};`}>{entry.data.title}</h1>
|
<h1 style={`view-transition-name: project-headline-${entry.id};`}>{entry.data.title}</h1>
|
||||||
<p>{entry.data.summary}</p>
|
<p>{entry.data.summary}</p>
|
||||||
{entry.data.tags && (
|
{(entry.data.tags || entry.data.repository) &&
|
||||||
<div class="tags">
|
(<div class="additional-meta">
|
||||||
{entry.data.tags.map(tech => <span class="tag">{tech}</span>)}
|
<div class="meta-tags">
|
||||||
</div>
|
{entry.data.tags && (
|
||||||
)}
|
<div class="tags">
|
||||||
|
{entry.data.tags?.map(tech => <span class="tag">{tech}</span>)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div class="meta-repository">
|
||||||
|
{ entry.data.repository && (
|
||||||
|
<a href={entry.data.repository} referrerpolicy="no-referrer">
|
||||||
|
<Icon name="simple-icons:git" style={`view-transition-name: project-git-${entry.id};`} />
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="glass-container content prose">
|
<div class="glass-container content prose">
|
||||||
@@ -39,6 +52,7 @@ const { Content } = await render(entry);
|
|||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
.tag {
|
.tag {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
@@ -49,4 +63,23 @@ const { Content } = await render(entry);
|
|||||||
.content {
|
.content {
|
||||||
line-height: 1.8;
|
line-height: 1.8;
|
||||||
}
|
}
|
||||||
|
.additional-meta {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
gap: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 1rem;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.meta-repository {
|
||||||
|
flex-shrink: 1;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
color: rgb(var(--accent-base));
|
||||||
|
}
|
||||||
|
.meta-repository a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
import { getCollection } from 'astro:content';
|
import { getCollection } from 'astro:content';
|
||||||
|
import { Icon } from "astro-icon/components";
|
||||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||||
|
|
||||||
const projects = await getCollection('portfolio');
|
const projects = await getCollection('portfolio');
|
||||||
@@ -16,11 +17,21 @@ projects.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
|
|||||||
<a href={`/portfolio/${project.id}`} class="glass-container link-card" style={`view-transition-name: project-header-${project.id};`}>
|
<a href={`/portfolio/${project.id}`} class="glass-container link-card" style={`view-transition-name: project-header-${project.id};`}>
|
||||||
<h2 style={`view-transition-name: project-headline-${project.id};`}>{project.data.title}</h2>
|
<h2 style={`view-transition-name: project-headline-${project.id};`}>{project.data.title}</h2>
|
||||||
<p>{project.data.summary}</p>
|
<p>{project.data.summary}</p>
|
||||||
{project.data.tags && (
|
{(project.data.tags || project.data.repository) &&
|
||||||
<div class="tags">
|
(<div class="additional-meta">
|
||||||
{project.data.tags?.map(tech => <span class="tag">{tech}</span>)}
|
<div class="meta-tags">
|
||||||
|
{project.data.tags && (
|
||||||
|
<div class="tags">
|
||||||
|
{project.data.tags?.map(tech => <span class="tag">{tech}</span>)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
<div class="meta-repository">
|
||||||
|
{ project.data.repository && (
|
||||||
|
<Icon name="simple-icons:git" style={`view-transition-name: project-git-${project.id};`} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>)}
|
||||||
</a>
|
</a>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -40,11 +51,22 @@ projects.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
|
|||||||
.link-card h2 {
|
.link-card h2 {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
.additional-meta {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
gap: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 1rem;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
.tags {
|
.tags {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
margin-top: 1rem;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
flex-grow: 1;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
.tag {
|
.tag {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
@@ -52,4 +74,11 @@ projects.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
|
|||||||
padding: 0.25rem 0.5rem;
|
padding: 0.25rem 0.5rem;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
}
|
}
|
||||||
|
.meta-repository {
|
||||||
|
flex-shrink: 1;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: rgb(var(--accent-base));
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user