fix: fix errors and reformat code

This commit is contained in:
saicaca committed 2024-08-03 16:44:38 +08:00
1 parent 1f93499ece
commit 0ad144add3
44 files changed
+550 -558

No files matched your search

+33 -24
View File
@@ -1,34 +1,43 @@
---
import path from "path";
import PostMetadata from "./PostMeta.astro";
import ImageWrapper from "./misc/ImageWrapper.astro";
import { Icon } from 'astro-icon/components';
import {i18n} from "../i18n/translation";
import I18nKey from "../i18n/i18nKey";
import {getDir} from "../utils/url-utils";
import path from 'path'
import PostMetadata from './PostMeta.astro'
import ImageWrapper from './misc/ImageWrapper.astro'
import { Icon } from 'astro-icon/components'
import { i18n } from '../i18n/translation'
import I18nKey from '../i18n/i18nKey'
import { getDir } from '../utils/url-utils'
interface Props {
class?: string;
entry: any;
title: string;
url: string;
published: Date;
tags: string[];
category: string;
image: string;
description: string;
draft: boolean;
style: string;
class?: string
entry: any
title: string
url: string
published: Date
tags: string[]
category: string
image: string
description: string
draft: boolean
style: string
}
const { entry, title, url, published, tags, category, image, description, style } = Astro.props;
const className = Astro.props.class;
const {
entry,
title,
url,
published,
tags,
category,
image,
description,
style,
} = Astro.props
const className = Astro.props.class
const hasCover = image !== undefined && image !== null && image !== '';
const hasCover = image !== undefined && image !== null && image !== ''
const coverWidth = "28%";
const { remarkPluginFrontmatter } = await entry.render();
const coverWidth = '28%'
const { remarkPluginFrontmatter } = await entry.render()
---
<div class:list={["card-base flex flex-col-reverse md:flex-col w-full rounded-[var(--radius-large)] overflow-hidden relative", className]} style={style}>
<div class:list={["pl-6 md:pl-9 pr-6 md:pr-2 pt-6 md:pt-7 pb-6 relative", {"w-full md:w-[calc(100%_-_52px_-_12px)]": !hasCover, "w-full md:w-[calc(100%_-_var(--coverWidth)_-_12px)]": hasCover}]}>