Skip to content
Merged
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
51 changes: 51 additions & 0 deletions _TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion src/components/Pages/Resume/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const {
</html>

<style>
{/** DO NOT ADD STYLES HERE - Use Tailwind classes on HTML elements, this are resets */}
/* DO NOT ADD STYLES HERE - Use Tailwind classes on HTML elements, these are resets */

*, *::before, *::after {
box-sizing: border-box;
Expand Down
2 changes: 2 additions & 0 deletions src/pages/about/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import PageLayout from '@layouts/PageLayout.astro'
import AboutPage from '@components/Pages/About/index.astro'

Expand Down
2 changes: 2 additions & 0 deletions src/pages/articles/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import { type CollectionEntry, getCollection } from 'astro:content'
import { isDev } from '@lib/config/environmentServer'
import PageLayout from '@layouts/PageLayout.astro'
Expand Down
2 changes: 2 additions & 0 deletions src/pages/case-studies/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import { getCollection, getEntry } from 'astro:content'
import { Picture } from 'astro:assets'
import Icon from '@components/Icon/index.astro'
Expand Down
2 changes: 2 additions & 0 deletions src/pages/consent/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import PageLayout from '@layouts/PageLayout.astro'
import ConsentPreferences from '@components/Pages/Consent/index.astro'

Expand Down
2 changes: 2 additions & 0 deletions src/pages/contact/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import { companyContactData } from '@lib/content/contactData'
import PageLayout from '@layouts/PageLayout.astro'
import ContactPage from '@components/Pages/Contact/index.astro'
Expand Down
2 changes: 2 additions & 0 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import BaseLayout from '@layouts/BaseLayout.astro'
import Backstage from '@components/Home/Backstage/index.astro'
import Carousel from '@components/Carousel/index.astro'
Expand Down
2 changes: 2 additions & 0 deletions src/pages/newsletter/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import PageLayout from '@layouts/PageLayout.astro'
import Newsletter from '@components/Pages/Newsletter/Signup/index.astro'

Expand Down
2 changes: 2 additions & 0 deletions src/pages/offline/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import PageLayout from '@layouts/PageLayout.astro'
import NetworkStatus from '@components/Toasts/NetworkStatus/index.astro'
import Offline from '@components/Pages/Offline/index.astro'
Expand Down
2 changes: 2 additions & 0 deletions src/pages/privacy/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import PageLayout from '@layouts/PageLayout.astro'
import PrivacyLayout from '@components/Pages/Privacy/index.astro'

Expand Down
2 changes: 2 additions & 0 deletions src/pages/privacy/my-data.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import PageLayout from '@layouts/PageLayout.astro'
import PrivacyForm from '@components/Pages/MyData/index.astro'

Expand Down
2 changes: 2 additions & 0 deletions src/pages/resume/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import { getCollection, render } from 'astro:content'
import Resume from '@components/Pages/Resume/index.astro'

Expand Down
2 changes: 2 additions & 0 deletions src/pages/services/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import { getCollection } from 'astro:content'
import PageLayout from '@layouts/PageLayout.astro'
import ServicesPage from '@components/Pages/Services/index.astro'
Expand Down
2 changes: 2 additions & 0 deletions src/pages/terms.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
export const prerender = true

import PageLayout from '@layouts/PageLayout.astro'
import TermsOfUsePage from '@components/Pages/TermsOfUse/index.astro'

Expand Down
Loading