Skip to content

Commit ef2df9a

Browse files
improve blog page performance
1 parent 41cb1c3 commit ef2df9a

14 files changed

Lines changed: 228 additions & 165 deletions

File tree

.astro/content.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,6 @@ declare module 'astro:content' {
177177
LiveContentConfig['collections'][C]['loader']
178178
>;
179179

180-
export type ContentConfig = typeof import("../src/content.config.js");
180+
export type ContentConfig = typeof import("./../src/content.config.js");
181181
export type LiveContentConfig = never;
182182
}
-1.1 MB
Loading
-377 KB
Loading

public/numpad/app.js

Lines changed: 0 additions & 60 deletions
This file was deleted.

public/numpad/config.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

public/numpad/controller.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

public/numpad/state.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

public/numpad/utils.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/components/BlogCard.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ const formattedDate = formatDate(date);
4848
<img
4949
src={image}
5050
alt={title}
51-
width="800"
52-
height="450"
51+
width="400"
52+
height="225"
5353
loading={priority ? "eager" : "lazy"}
5454
fetchpriority={priority ? "high" : "auto"}
5555
decoding="async"
@@ -65,7 +65,7 @@ const formattedDate = formatDate(date);
6565
tags
6666
.slice(0, 2)
6767
.map((tag: string) => (
68-
<span class="bg-brandBlue rounded-full border border-cyan-500/20 px-3 py-1 text-xs font-medium text-white">
68+
<span class="rounded-full border border-cyan-500/20 bg-brandBlue px-3 py-1 text-xs font-medium text-white">
6969
#{tag}
7070
</span>
7171
))

src/components/Header.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Picture } from "astro:assets";
33
import "../assets/styles/custom-font.css";
44
import ThemeToggle from "@/components/ThemeToggle.astro";
5-
import logoImage from "@/assets/images/logo.png";
5+
import logoImage from "@/assets/images/logo.webp";
66
import navLinks from "@/data/navLinks.json";
77
import NavItem from "@/components/NavItem.astro";
88
@@ -163,7 +163,9 @@ const isCurrentPage = (path: string) => {
163163
const closeBtn = document.getElementById("closeMenuBtn");
164164
const menu = document.getElementById("mobileMenu");
165165

166-
if (!openBtn || !closeBtn || !menu) return;
166+
if (!openBtn || !closeBtn || !menu || openBtn.dataset.initialized) return;
167+
168+
openBtn.dataset.initialized = "true";
167169

168170
openBtn.addEventListener("click", () => {
169171
menu.classList.remove("hidden");

0 commit comments

Comments
 (0)