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

Fix server-side rendering for events and books #317

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mattobee
Copy link
Member

@mattobee mattobee commented Jan 14, 2025

Related to #316

Implement server-side rendering for event pages to display events correctly when client-side JavaScript is disabled.

  • Index Page (src/pages/index.astro)

    • Import getEvents and getBooks functions.
    • Fetch events and books server-side and pass them as props to EventList.
  • Past Events Page (src/pages/past-events.astro)

    • Import getEvents function.
    • Fetch past events server-side and pass them as props to EventList.
  • EventList Component (src/components/EventList.vue)

    • Add props for events and books to support server-side rendering.
    • Use props for events and books if provided, otherwise fetch client-side.
  • Edge Functions (netlify/edge-functions/get-events.ts and netlify/edge-functions/get-books.ts)

    • Export getEvents and getBooks functions for server-side use.

For more details, open the Copilot Workspace session.

Related to #316

Implement server-side rendering for event pages to display events correctly when client-side JavaScript is disabled.

* **Index Page (`src/pages/index.astro`)**
  - Import `getEvents` and `getBooks` functions.
  - Fetch events and books server-side and pass them as props to `EventList`.

* **Past Events Page (`src/pages/past-events.astro`)**
  - Import `getEvents` function.
  - Fetch past events server-side and pass them as props to `EventList`.

* **EventList Component (`src/components/EventList.vue`)**
  - Add props for `events` and `books` to support server-side rendering.
  - Use props for `events` and `books` if provided, otherwise fetch client-side.

* **Edge Functions (`netlify/edge-functions/get-events.ts` and `netlify/edge-functions/get-books.ts`)**
  - Export `getEvents` and `getBooks` functions for server-side use.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/eventua11y/eventua11y.com/issues/316?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for eventua11y failed. Why did it fail? →

Name Link
🔨 Latest commit 64b1ca8
🔍 Latest deploy log https://app.netlify.com/sites/eventua11y/deploys/67865be332be8d0007c6c5f3

…astro`

* **index.astro**
  - Remove import statements for `getEvents` and `getBooks`
  - Fetch events and books using `fetch` and pass them as props to `EventList`

* **past-events.astro**
  - Remove import statement for `getEvents`
  - Fetch past events using `fetch` and pass them as props to `EventList`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Not Started
Development

Successfully merging this pull request may close these issues.

1 participant