diff --git a/_TODO.md b/_TODO.md index dc577ea1..41fe37f3 100644 --- a/_TODO.md +++ b/_TODO.md @@ -40,3 +40,54 @@ https://aws.plainenglish.io/how-to-build-a-chatbot-using-aws-lex-and-lambda-in-2 - Need to move the unsubscribe link into an Action and handle it entirely within our website instead of on Hubspot - Need to add a newsletter publishing workflow as an action, using the newsletter static segment imported from Hubspot + +## Performance Issues + +3. Audit the homepage hydration/chunk fan-out after prerendering. The 22 JS chunks suggest too much client code is shipping for a marketing landing page. + +### Search page + +One route that is dynamic now but probably does not need to be: + +/search + +It is currently marked prerender = false in index.astro:2, but the UI is already client-driven. index.astro:8 reads q, and the real search happens through the action in action.ts:12. That means /search can very likely be a static shell page and let the client read window.location.search and call the action. So I would not keep this dynamic unless you specifically want SSR-rendered search results for SEO. + +### Tags page + +One caution: + +src/pages/tags/[tag].astro is prerendered but also reads ?page=. That is not a reason to keep it dynamic, but it is a sign that query-param pagination there may not be doing what you expect in a prerendered route. + +It's using page for plain old server-side pagination. + +In src/pages/tags/[tag].astro, the route sets ITEMS_PER_PAGE = 12, then reads the query param here: + +src/pages/tags/[tag].astro + + +const currentPage = parseInt(Astro.url.searchParams.get('page') || '1') +It uses that value to: + +Compute the slice boundaries: +src/pages/tags/[tag].astro + +const startIndex = (currentPage - 1) * ITEMS_PER_PAGEconst endIndex = startIndex + ITEMS_PER_PAGE +Slice the sorted articles for that tag: +src/pages/tags/[tag].astro + +const paginatedContent = sortedContent.slice(startIndex, endIndex) +Render the pagination UI and link targets: +src/pages/tags/[tag].astro +That block builds: + +Previous / Next +numbered page links +ellipsis when there are many pages +links like /tags/foo?page=2, /tags/foo?page=3, etc. +So the intent is: + +/tags/some-tag means page 1 +/tags/some-tag?page=2 means articles 13-24 +/tags/some-tag?page=3 means the next 12, and so on +One important caveat: this route is also marked prerendered in src/pages/tags/[tag].astro. That means the code is written like SSR pagination, but because the route is static, the page query param may not actually produce distinct server-rendered HTML at runtime. In other words, the code is trying to use ?page= to choose which slice to render, but prerendering makes that suspicious. diff --git a/src/components/Pages/Resume/index.astro b/src/components/Pages/Resume/index.astro index 5e1e8cef..b29381a9 100644 --- a/src/components/Pages/Resume/index.astro +++ b/src/components/Pages/Resume/index.astro @@ -104,7 +104,7 @@ const {