Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor bug fixes #18

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/Gallery.astro
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const resources = search.resources as CloudinaryResource[];
class="resource absolute align-bottom top-0 w-full h-full object-cover opacity-0 transition-opacity ease-in duration-1000 fullscreen:pointer-events-none"
onload="this.style.opacity=1; this.parentNode.previousElementSibling.style.display = 'none';" // fade in image after loading, remove loading icon
loading={`${index <= 5 ? "eager" : "lazy"}`}
background="#000"
alt={`"Concert Photograph by Eric Dew${CloudinaryResource.context ? " of " + CloudinaryResource.context.alt : ""}`}
/>
) : (
Expand Down Expand Up @@ -432,7 +433,7 @@ const resources = search.resources as CloudinaryResource[];
startY = e.changedTouches[0].screenY;
}, { passive: true });

document.addEventListener("touchmove", (e) => {
document.addEventListener("touchmove", () => {
isScrolling = true;
}, { passive: true });

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: MacBook Setup for Concert Photographers
description: Productivity tools and aesthetic improvements I use to improve my workflow efficiency.
cover: "src/content/blog/_assets/macbook-setup-for-concert-photographers/cover.jpg"
cover: "/src/content/blog/_assets/macbook-setup-for-concert-photographers/cover.jpg"
published: 2023-03-21
---

Expand Down
3 changes: 2 additions & 1 deletion src/pages/[post].astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Layout from "../layouts/Layout.astro";
import Grain from "../components/ui/Grain.astro";
import FormattedDate from "../components/ui/FormattedDate.astro";
import Navbar from "../components/ui/Navbar.astro";
import { Image } from "@astrojs/image/components";

export async function getStaticPaths() {
const posts = await getCollection("blog", ({ data }) => {
Expand Down Expand Up @@ -49,7 +50,7 @@ function getReadingTime(content: string) {
<h1>{post.data.title}</h1>

{post.data.cover
? <img src={post.data.cover} />
? <Image src={post.data.cover} alt="" width={1200} height={630} />
: <></>
}
</div>
Expand Down
6 changes: 2 additions & 4 deletions src/pages/blog.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getCollection } from "astro:content";
import Grain from "../components/ui/Grain.astro";
import FormattedDate from "../components/ui/FormattedDate.astro";
import Navbar from "../components/ui/Navbar.astro";
import { Image } from "@astrojs/image/components";

const posts = await getCollection("blog", ({ data }) => {
return import.meta.env.DEV || (!data.draft && data.published < new Date());
Expand All @@ -26,10 +27,7 @@ const posts = await getCollection("blog", ({ data }) => {
class="block rounded-lg border border-gray-200 bg-white p-6 shadow dark:border-zinc-700 dark:bg-zinc-800"
>
{post.data.cover
? <img
class="rounded-lg mb-6"
src={post.data.cover}
/>
? <Image class="rounded-lg mb-6" src={post.data.cover} alt="" width={1200} height={630} />
: <></>
}

Expand Down