William's Blog
--
-
- {
- posts.map((post) => (
-
-
-
- {post.data.heroImage && || }
-
{post.data.title}
--
- --
- ))
- }
-
From 33766b3db9d3354a3b219b7e98044755d4bd0ea8 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Sat, 30 Nov 2024 15:18:22 +0800 Subject: [PATCH] add ads --- .vscode/extensions.json | 4 - .vscode/launch.json | 11 --- src/pages/index.astro | 200 +++++++++++++++++++++------------------- 3 files changed, 106 insertions(+), 109 deletions(-) delete mode 100644 .vscode/extensions.json delete mode 100644 .vscode/launch.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index d56ee46..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"], - "unwantedRecommendations": [] -} diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index e368c54..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] -} diff --git a/src/pages/index.astro b/src/pages/index.astro index 4924f63..4b79074 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,105 +1,117 @@ --- -import BaseHead from '../components/BaseHead.astro'; -import Footer from '../components/Footer.astro'; -import { SITE_DESCRIPTION } from '../consts'; -import { getCollection } from 'astro:content'; -import FormattedDate from '../components/FormattedDate.astro'; +import BaseHead from "../components/BaseHead.astro"; +import Footer from "../components/Footer.astro"; +import { SITE_DESCRIPTION } from "../consts"; +import { getCollection } from "astro:content"; +import FormattedDate from "../components/FormattedDate.astro"; -const posts = (await getCollection('blog')).sort( - (a, b) => Number(b.data.published) - Number(a.data.published) -); +const posts = (await getCollection("blog")).sort((a, b) => Number(b.data.published) - Number(a.data.published)); function getRandomPlaceholder() { - const random = Math.floor(Math.random() * 4) + 1; - return `https://cdn.hrsn.net/blog/placeholders/${random}.jpg`; + const random = Math.floor(Math.random() * 4) + 1; + return `https://cdn.hrsn.net/blog/placeholders/${random}.jpg`; } --- -
-
-
+