Skip to content

wrap site with layout#59

Open
interim17 wants to merge 4 commits intomainfrom
gatsby-browser
Open

wrap site with layout#59
interim17 wants to merge 4 commits intomainfrom
gatsby-browser

Conversation

@interim17
Copy link
Contributor

Problem

Advances #51

Solution

A few things here:

  • using wrapPageElement and wrapRootElement in gatsby browser APIs to wrap pages in themes, layouts, head, etc. ( more DRY, more idiomatic gatsby)
  • encapsulate head and layout
  • remove layout from components that were using it (now redundant)
  • rename/move SiteMetadata from component -> hook (just because that's what it is)
  • add AICS logo for favicon
  • update site title and description in gatsby-config
  • remove iframeResizer (from template, we don't use it)
  • add gatsby-ssr.js as a just in case because docs recommend when using gatsby-browser.js APIs

@netlify
Copy link

netlify bot commented Feb 26, 2026

Deploy Preview for project-idea-board ready!

Name Link
🔨 Latest commit 71bd8fe
🔍 Latest deploy log https://app.netlify.com/projects/project-idea-board/deploys/69a5d60dc7186f000866d800
😎 Deploy Preview https://deploy-preview-59--project-idea-board.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@interim17 interim17 changed the title wrap site in layout and theme with gatsby browser API wrap site with layout Feb 26, 2026
@interim17 interim17 requested a review from Copilot February 26, 2026 03:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR centralizes site-wide layout/theming/head handling using Gatsby’s wrapRootElement and wrapPageElement, reducing per-page boilerplate and aligning with Gatsby idioms (advances #51).

Changes:

  • Add wrapRootElement/wrapPageElement in gatsby-browser.js (and mirror in gatsby-ssr.js) to apply Ant Design theming and a shared Layout wrapper globally.
  • Extract global <head> metadata into GlobalHead and move site metadata access into a new useSiteMetadata hook.
  • Remove redundant Layout wrapping from templates/pages and remove the unused iframe resizer asset; update site title/description and add SVG favicon.

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
static/img/AICS-logo.svg Adds AICS SVG logo for use as favicon.
static/iframeResizer.js Removes unused iframe resizer script from static/.
src/templates/tags.tsx Removes per-template Layout wrapper (now globally applied).
src/templates/program.tsx Removes per-template Layout wrapper (now globally applied).
src/templates/index-page.tsx Removes per-template Layout wrapper (now globally applied).
src/templates/idea-post.tsx Removes per-template Layout wrapper and simplifies “not found” rendering.
src/templates/allenite.tsx Removes per-template Layout wrapper (now globally applied).
src/templates/about-page.tsx Removes per-template Layout wrapper (now globally applied).
src/pages/tags/index.js Removes per-page Layout wrapper (now globally applied).
src/pages/ideas/index.tsx Removes per-page Layout wrapper (now globally applied).
src/hooks/useSiteMetadata.ts Introduces a hook to read siteMetadata via useStaticQuery.
src/components/Layout.tsx Simplifies layout to structural wrapper + GlobalHead; removes iframe script and theme provider from component.
src/components/GlobalHead.tsx Centralizes global Helmet tags (title/description, fonts, OG tags, favicon).
gatsby-browser.js Adds Gatsby API wrappers to apply Ant Design ConfigProvider and global Layout.
gatsby-ssr.js Adds SSR-side wrapper hookup (but currently with a module-syntax issue).
gatsby-config.js Updates siteMetadata title/description.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants