{"id":15192401,"url":"https://github.com/gah-code/g-code","last_synced_at":"2026-02-11T08:33:39.624Z","repository":{"id":204055021,"uuid":"711010390","full_name":"gah-code/g-code","owner":"gah-code","description":"Website Update Soft Launch 2024: Contentful-Powered Gatsby Site","archived":false,"fork":false,"pushed_at":"2025-03-18T05:01:58.000Z","size":12508,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-06T08:52:54.991Z","etag":null,"topics":["contentful","gatsby","graphql","graphql-api","netlify","styled-components","theme-ui"],"latest_commit_sha":null,"homepage":"https://gilbertaharo.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gah-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-28T00:40:50.000Z","updated_at":"2025-03-18T05:02:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"df8807c6-bdab-4765-b647-3ee5831aa488","html_url":"https://github.com/gah-code/g-code","commit_stats":{"total_commits":103,"total_committers":1,"mean_commits":103.0,"dds":0.0,"last_synced_commit":"4584e6b622f43d78c896520e148fe6b01c328b02"},"previous_names":["gah-code/g-code"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gah-code/g-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gah-code%2Fg-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gah-code%2Fg-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gah-code%2Fg-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gah-code%2Fg-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gah-code","download_url":"https://codeload.github.com/gah-code/g-code/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gah-code%2Fg-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29329852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contentful","gatsby","graphql","graphql-api","netlify","styled-components","theme-ui"],"created_at":"2024-09-27T21:23:13.209Z","updated_at":"2026-02-11T08:33:39.610Z","avatar_url":"https://github.com/gah-code.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My 2025 Website Update: Contentful-Powered Theme UI Gatsby Site\r\n\r\n![Lighthouse Score](./src/assets/images/lighthouse-score.png)\r\n\r\n## Purpose\r\n\r\nThis project showcases a dynamic web application built using Gatsby, a modern static site generator, integrated with Contentful CMS for seamless content management. The site features two main content types: notes and recipes, each enriched with multimedia elements and categorized through tags for enhanced navigation and user engagement.\r\n\r\n## Key Features\r\n\r\n### Dynamic Content Management\r\n\r\n- Utilizes Contentful CMS to manage and deliver content for notes and code recipes, allowing non-technical users to easily add, modify, and organize content.\r\n- Theme UI\r\n\r\n### Advanced Image Handling\r\n\r\n- Implements `gatsby-plugin-image` for optimal image loading with advanced image processing, providing a fast, responsive, and visually engaging user experience.\r\n- Supports modern image formats like WEBP and AVIF, ensuring high performance and efficiency.\r\n\r\n### Responsive and Accessible Design\r\n\r\n- Features a fully responsive design using custom CSS and Theme UI, ensuring the website is accessible and functional across various devices and screen sizes.\r\n- Focuses on accessibility best practices to cater to a diverse audience, including those with disabilities.\r\n\r\n### SEO and Performance Optimized\r\n\r\n- Built with SEO best practices in mind, including proper use of headings, meta tags, and alt text for images to enhance search engine visibility.\r\n- Leverages Gatsby's static generation capabilities for blazing-fast load times and optimal web performance.\r\n\r\n## Technology Stack\r\n\r\n- **Frontend:** Gatsby (React-based framework)\r\n- **CMS:** Contentful\r\n- **Styling:** Styled Components, CSS, and Theme UI\r\n- **Hosting/Deployment:** Netlify, Cloudflare\r\n\r\n## Goals\r\n\r\n- To create an informative and interactive platform where users can easily access a variety of notes and recipes.\r\n- To demonstrate the integration of a headless CMS with a static site generator for efficient content updates and the performance benefits of static site generation.\r\n- To provide a template or case study for similar projects that require dynamic content management combined with the performance benefits of static site generation.\r\n\r\n## TypeScript and Testing\r\n\r\nThe project uses TypeScript for type checking and Jest for testing React components. Key updates include:\r\n\r\n- Adding type declarations for components without existing TypeScript definitions.\r\n- Configuring Jest to run tests in a TypeScript environment.\r\n- Fixing common TypeScript errors related to props and module imports.\r\n\r\n### TypeScript Configuration\r\n\r\n- **Updated `tsconfig.json`**: The TypeScript configuration was updated to enable the following:\r\n  - `esModuleInterop` for better module compatibility.\r\n  - `jsx` support for React components.\r\n  - Inclusion of all TypeScript files in the `src` directory.\r\n\r\n## Responsive Layout with Theme UI\r\n\r\nYou can create a similar responsive layout using Theme UI by utilizing its responsive array syntax and media queries directly in the `sx` prop. Below is an example of how to translate styled section CSS into a Theme UI `Box` component, including responsive values for `column-gap`, `row-gap`, and `padding`:\r\n\r\n```jsx\r\n/** @jsxImportSource theme-ui */\r\nimport { Box } from 'theme-ui';\r\n\r\nconst ResponsiveSection = (props) =\u003e (\r\n  \u003cBox\r\n    as=\"section\"\r\n    sx={{\r\n      maxWidth: props.maxWidth || '120rem',\r\n      padding: props.padding || '3.9rem 2rem',\r\n      '@media screen and (max-width: 84em)': {\r\n        columnGap: props.columnGap84 || '5rem',\r\n        rowGap: props.rowGap84 || '7rem',\r\n      },\r\n      '@media screen and (max-width: 75em)': {\r\n        columnGap: props.columnGap75 || '2rem',\r\n        rowGap: props.rowGap75 || '6.9rem',\r\n      },\r\n      '@media screen and (max-width: 59em)': {\r\n        columnGap: props.columnGap59 || '1rem',\r\n        rowGap: props.rowGap59 || '6rem',\r\n      },\r\n      '@media screen and (max-width: 34em)': {\r\n        padding: props.paddingSmall || '3rem 0.8rem 2rem 0.8rem',\r\n        rowGap: props.rowGap34 || '5rem',\r\n      },\r\n    }}\r\n    {...props}\r\n  /\u003e\r\n);\r\n\r\nexport default ResponsiveSection;\r\n```\r\n\r\n### Explanation\r\n\r\n1. **`as=\"section\"`**: The `Box` component is given an HTML element type of `section`, making it functionally equivalent to `styled.section`.\r\n2. **Responsive Styling Using `@media` Queries**: Traditional CSS media queries are used within Theme UI by nesting them inside the `sx` object.\r\n3. **Default Values or Prop-based Values**: Default values are provided for `maxWidth`, `padding`, `columnGap`, and `rowGap`, with the ability to override using props.\r\n4. **Responsive Values for `padding`, `columnGap`, and `rowGap`**: Media queries adjust `padding`, `columnGap`, and `rowGap` at specific breakpoints to match the original styled section CSS.\r\n\r\n### Example Usage\r\n\r\nTo use the `ResponsiveSection` component:\r\n\r\n```jsx\r\nimport ResponsiveSection from './ResponsiveSection';\r\n\r\nconst App = () =\u003e (\r\n  \u003cResponsiveSection\r\n    maxWidth=\"100rem\"\r\n    padding=\"4rem 2rem\"\r\n    columnGap84=\"4rem\"\r\n    rowGap84=\"6rem\"\r\n    columnGap75=\"1.5rem\"\r\n    rowGap75=\"6rem\"\r\n    columnGap59=\"0.5rem\"\r\n    rowGap59=\"5.5rem\"\r\n    paddingSmall=\"2rem 1rem\"\r\n    rowGap34=\"4rem\"\r\n  \u003e\r\n    {/* Your content goes here */}\r\n  \u003c/ResponsiveSection\u003e\r\n);\r\n\r\nexport default App;\r\n```\r\n\r\n### Key Advantages of Theme UI Implementation\r\n\r\n1. **Flexibility**: You can pass different values through props to dynamically change the styling, similar to how styled-components handle props.\r\n2. **Integration with Theme**: Theme UI allows direct integration with your theme tokens (e.g., `colors`, `space`) for a consistent design system.\r\n3. **Readability**: Using the `sx` prop keeps your styles co-located with your component logic, making it easier to manage.\r\n\r\n## Deployment Status\r\n\r\n[![Netlify Status](https://api.netlify.com/api/v1/badges/f2ecbaf1-b540-48fd-82fd-b0d389e98a81/deploy-status)](https://app.netlify.com/sites/gilbertaharocode/deploys)\r\n\r\n## References\r\n\r\n- [Node](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgah-code%2Fg-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgah-code%2Fg-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgah-code%2Fg-code/lists"}