home: fix nav active-section at page bottom + exact progress bar; add blog tags to Writing
build-and-deploy / build (push) Failing after 10m38s
build-and-deploy / build (push) Failing after 10m38s
- Nav underline highlighted the wrong section at the bottom (the short last section never crossed the threshold) — force the last section when scrolled to the bottom so Contact lights up instead of Skills - Scroll-progress bar: compute progress from scrollY/maxScroll so it spans a true 0→1 (Motion's default topped out ~0.89 at the bottom) - Writing section: add blog tag chips linking to /blog/tags/<tag>/
This commit is contained in:
+24
-3
@@ -8,13 +8,15 @@ import ProjectCard from "../components/ProjectCard.astro";
|
||||
import PostList from "../components/PostList.astro";
|
||||
import Contact from "../components/Contact.astro";
|
||||
import { skills } from "../data/skills";
|
||||
import { getPosts } from "../lib/blog";
|
||||
import { getPosts, allTags } from "../lib/blog";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
const featuredProjects = (await getCollection("projects", (p) => p.data.featured)).sort(
|
||||
(a, b) => a.data.order - b.data.order,
|
||||
);
|
||||
const recentPosts = (await getPosts()).slice(0, 3);
|
||||
const allPosts = await getPosts();
|
||||
const recentPosts = allPosts.slice(0, 3);
|
||||
const postTags = allTags(allPosts);
|
||||
---
|
||||
|
||||
<Layout path="/">
|
||||
@@ -44,6 +46,14 @@ const recentPosts = (await getPosts()).slice(0, 3);
|
||||
Lessons from edge Kubernetes, GPUs, and running infrastructure like it matters —
|
||||
written up as I go.
|
||||
</p>
|
||||
{postTags.length > 0 && (
|
||||
<nav class="writing__tags" aria-label="Browse the blog by tag" data-reveal>
|
||||
<span class="mono writing__tags-label">tags:</span>
|
||||
{postTags.map((t) => (
|
||||
<a class="tag" href={`/blog/tags/${t}/`}>{t}</a>
|
||||
))}
|
||||
</nav>
|
||||
)}
|
||||
<PostList posts={recentPosts} />
|
||||
<p class="projects__more" data-reveal>
|
||||
<a class="btn" href="/blog/">Read the blog →</a>
|
||||
@@ -72,7 +82,18 @@ const recentPosts = (await getPosts()).slice(0, 3);
|
||||
}
|
||||
.writing__intro {
|
||||
max-width: 52ch;
|
||||
margin-bottom: var(--space-5);
|
||||
margin-bottom: var(--space-4);
|
||||
color: var(--text-dim);
|
||||
}
|
||||
.writing__tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: var(--space-6);
|
||||
}
|
||||
.writing__tags-label {
|
||||
font-size: var(--step--1);
|
||||
color: var(--text-faint);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user