mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-11 06:42:53 +01:00
Some checks failed
Code quality / quality (push) Failing after 4s
Build and Check / Astro Check for Node.js 22 (push) Failing after 4s
Build and Check / Astro Check for Node.js 23 (push) Failing after 4s
Build and Check / Astro Build for Node.js 22 (push) Failing after 5s
Build and Check / Astro Build for Node.js 23 (push) Failing after 4s
* fix: Correct template literals for aria-label attributes in PostMeta and Pagination components * fix: Update template literals to use correct syntax in multiple components
44 lines
1.8 KiB
Plaintext
44 lines
1.8 KiB
Plaintext
---
|
|
import { Icon } from "astro-icon/components";
|
|
import { licenseConfig, profileConfig } from "../../config";
|
|
import I18nKey from "../../i18n/i18nKey";
|
|
import { i18n } from "../../i18n/translation";
|
|
import { formatDateToYYYYMMDD } from "../../utils/date-utils";
|
|
|
|
interface Props {
|
|
title: string;
|
|
slug: string;
|
|
pubDate: Date;
|
|
class: string;
|
|
}
|
|
|
|
const { title, pubDate } = Astro.props;
|
|
const className = Astro.props.class;
|
|
const profileConf = profileConfig;
|
|
const licenseConf = licenseConfig;
|
|
const postUrl = decodeURIComponent(Astro.url.toString());
|
|
---
|
|
<div class={`relative transition overflow-hidden bg-[var(--license-block-bg)] py-5 px-6 ${className}`}>
|
|
<div class="transition font-bold text-black/75 dark:text-white/75">
|
|
{title}
|
|
</div>
|
|
<a href={postUrl} class="link text-[var(--primary)]">
|
|
{postUrl}
|
|
</a>
|
|
<div class="flex gap-6 mt-2">
|
|
<div>
|
|
<div class="transition text-black/30 dark:text-white/30 text-sm">{i18n(I18nKey.author)}</div>
|
|
<div class="transition text-black/75 dark:text-white/75 line-clamp-2">{profileConf.name}</div>
|
|
</div>
|
|
<div>
|
|
<div class="transition text-black/30 dark:text-white/30 text-sm">{i18n(I18nKey.publishedAt)}</div>
|
|
<div class="transition text-black/75 dark:text-white/75 line-clamp-2">{formatDateToYYYYMMDD(pubDate)}</div>
|
|
</div>
|
|
<div>
|
|
<div class="transition text-black/30 dark:text-white/30 text-sm">{i18n(I18nKey.license)}</div>
|
|
<a href={licenseConf.url} target="_blank" class="link text-[var(--primary)] line-clamp-2">{licenseConf.name}</a>
|
|
</div>
|
|
</div>
|
|
<Icon name="fa6-brands:creative-commons" class="transition text-[15rem] absolute pointer-events-none right-6 top-1/2 -translate-y-1/2 text-black/5 dark:text-white/5"></Icon>
|
|
</div>
|