2026-03-24 17:33:01 +00:00
|
|
|
---
|
2026-03-24 18:01:45 +00:00
|
|
|
import BaseLayout from "./BaseLayout.astro";
|
2026-03-24 18:39:50 +00:00
|
|
|
import Giscus from "@/components/Giscus.astro";
|
2026-03-25 07:25:40 +00:00
|
|
|
import { getLangFromUrl, getTranslations } from "@/i18n";
|
2026-03-24 18:01:45 +00:00
|
|
|
import "@/styles/global.css";
|
2026-03-25 07:25:40 +00:00
|
|
|
|
2026-03-24 17:33:01 +00:00
|
|
|
const { frontmatter } = Astro.props;
|
2026-03-25 07:25:40 +00:00
|
|
|
const lang = getLangFromUrl(Astro.url);
|
|
|
|
|
const t = getTranslations(lang);
|
2026-03-24 17:33:01 +00:00
|
|
|
---
|
2026-03-24 18:01:45 +00:00
|
|
|
|
2026-03-24 17:33:01 +00:00
|
|
|
<BaseLayout pageTitle={frontmatter.title}>
|
2026-03-25 07:25:40 +00:00
|
|
|
<div class="post-header">
|
|
|
|
|
<div class="post-meta">
|
|
|
|
|
<h1 class="post-title">{frontmatter.title}</h1>
|
|
|
|
|
<p class="description"><em>{frontmatter.description}</em></p>
|
|
|
|
|
<p class="meta-line">
|
|
|
|
|
{t.post.publishedOn}: {frontmatter.pubDate.toLocaleDateString()}
|
|
|
|
|
</p>
|
|
|
|
|
<p class="meta-line">{t.post.writtenBy}: {frontmatter.author}</p>
|
|
|
|
|
|
|
|
|
|
<div class="tags">
|
|
|
|
|
{
|
|
|
|
|
frontmatter.tags.map((tag: string) => (
|
|
|
|
|
<p class="tag">
|
|
|
|
|
<a href={`/${lang}/tags/${tag}`}>{tag}</a>
|
|
|
|
|
</p>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<img
|
|
|
|
|
src={frontmatter.image.url}
|
|
|
|
|
alt={frontmatter.image.alt}
|
|
|
|
|
class="post-cover"
|
|
|
|
|
/>
|
2026-03-24 18:01:45 +00:00
|
|
|
</div>
|
|
|
|
|
|
2026-03-24 17:33:01 +00:00
|
|
|
<slot />
|
2026-03-24 18:39:50 +00:00
|
|
|
|
|
|
|
|
<Giscus />
|
2026-03-24 18:01:45 +00:00
|
|
|
</BaseLayout>
|
2026-03-25 07:25:40 +00:00
|
|
|
|
2026-03-24 18:01:45 +00:00
|
|
|
<style>
|
|
|
|
|
a {
|
2026-03-25 07:25:40 +00:00
|
|
|
color: var(--post-link-color);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.post-header {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: minmax(0, 1fr) 300px;
|
|
|
|
|
align-items: start;
|
|
|
|
|
gap: 1.5rem;
|
|
|
|
|
margin-bottom: 1.5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.post-meta {
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.post-title {
|
|
|
|
|
margin: 0 0 0.5rem 0;
|
|
|
|
|
line-height: 1.25;
|
|
|
|
|
overflow-wrap: anywhere;
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.description {
|
|
|
|
|
margin: 0 0 0.7rem 0;
|
|
|
|
|
opacity: 0.9;
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
overflow-wrap: anywhere;
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.meta-line {
|
|
|
|
|
margin: 0.3rem 0;
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
overflow-wrap: anywhere;
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.post-cover {
|
|
|
|
|
width: 300px;
|
|
|
|
|
height: auto;
|
|
|
|
|
aspect-ratio: 16 / 9;
|
|
|
|
|
object-fit: cover;
|
|
|
|
|
object-position: center;
|
|
|
|
|
border-radius: 0.4rem;
|
|
|
|
|
display: block;
|
2026-03-24 18:01:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tags {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
2026-03-25 07:25:40 +00:00
|
|
|
gap: 0.4rem;
|
|
|
|
|
margin-top: 0.8rem;
|
|
|
|
|
min-width: 0;
|
2026-03-24 18:01:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tag {
|
2026-03-25 07:25:40 +00:00
|
|
|
margin: 0;
|
|
|
|
|
padding: 0.22em 0.65em;
|
|
|
|
|
font-size: 0.88rem;
|
|
|
|
|
line-height: 1.2;
|
|
|
|
|
border: 1px dashed #8b6b4a;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tag a {
|
|
|
|
|
color: #6f4e37;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
overflow-wrap: anywhere;
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tag a:hover {
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.dark) .tag {
|
|
|
|
|
border-color: #d8c7a1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:global(.dark) .tag a {
|
|
|
|
|
color: #e6d8b8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 560px) {
|
|
|
|
|
.post-header {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.post-cover {
|
|
|
|
|
width: 100%;
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
}
|
2026-03-24 18:01:45 +00:00
|
|
|
}
|
|
|
|
|
</style>
|