Skip to content

Commit

Permalink
add:增加首页图片
Browse files Browse the repository at this point in the history
  • Loading branch information
Parsifa1 committed Dec 29, 2023
1 parent 731847f commit ef9c52e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
Binary file added public/front.webp
Binary file not shown.
36 changes: 20 additions & 16 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
---
import { getCollection } from "astro:content";
import Layout from "@layouts/Layout.astro";
import Header from "@components/Header.astro";
import Footer from "@components/Footer.astro";
import LinkButton from "@components/LinkButton.astro";
import Hr from "@components/Hr.astro";
import Card from "@components/Card";
import Socials from "@components/Socials.astro";
import getSortedPosts from "@utils/getSortedPosts";
import slugify from "@utils/slugify";
import { SOCIALS } from "@config";
import { getCollection } from 'astro:content'
import Layout from '@layouts/Layout.astro'
import Header from '@components/Header.astro'
import Footer from '@components/Footer.astro'
import LinkButton from '@components/LinkButton.astro'
import Hr from '@components/Hr.astro'
import Card from '@components/Card'
import Socials from '@components/Socials.astro'
import getSortedPosts from '@utils/getSortedPosts'
import slugify from '@utils/slugify'
import { Image } from 'astro:assets'
import { SOCIALS } from '@config'
const posts = await getCollection("blog");
import frontpic from '../../public/front.webp'
const sortedPosts = getSortedPosts(posts);
const featuredPosts = sortedPosts.filter(({ data }) => data.featured);
const posts = await getCollection('blog')
const socialCount = SOCIALS.filter((social) => social.active).length;
const sortedPosts = getSortedPosts(posts)
const featuredPosts = sortedPosts.filter(({ data }) => data.featured)
const socialCount = SOCIALS.filter((social) => social.active).length
---

<Layout>
Expand All @@ -43,6 +46,7 @@ const socialCount = SOCIALS.filter((social) => social.active).length;
<p>"Hinc itur ad astra"</p>
<p>"我们自此通往繁星"</p>
<p>Algorithm, Computer and Math</p>
<Image src={frontpic} alt="A description of my image." />
{
// only display if at least one social link is enabled
socialCount > 0 && (
Expand Down Expand Up @@ -90,7 +94,7 @@ const socialCount = SOCIALS.filter((social) => social.active).length;
frontmatter={data}
secHeading={false}
/>
),
)
)
}
</ul>
Expand Down

0 comments on commit ef9c52e

Please sign in to comment.