An open API service indexing awesome lists of open source software.

https://github.com/gah-code/gilbertoharosite

This project is a modern web application that demonstrates my front-end design patterns, passion for creative solutions, and a variety of projects, including blogs with code snippets, research notes from my learning journey, and more.
https://github.com/gah-code/gilbertoharosite

content-modelling contentful css gatsby gatsby-theme graphql mdx pwa seo-friendly typescript ui

Last synced: 2 months ago
JSON representation

This project is a modern web application that demonstrates my front-end design patterns, passion for creative solutions, and a variety of projects, including blogs with code snippets, research notes from my learning journey, and more.

Awesome Lists containing this project

README

          

# My 2025 Website Update: Contentful-Powered Gatsby Site 1.3.0
>

![Lighthouse Score](./light-house.png)

![Content Model](./content-mod-lastest.png)

[![Netlify Status](https://api.netlify.com/api/v1/badges/f2ecbaf1-b540-48fd-82fd-b0d389e98a81/deploy-status)](https://app.netlify.com/sites/gilbertaharocode/deploys)

## Project Overview

This repository contains a **Gatsby** website integrated with **Contentful** for content management and a newly introduced **Blog Post** system. By leveraging **GraphQL** queries and Contentful’s flexible data model, the site can fetch and render content for **Pages**, **Blog Posts**, and modular homepage blocks (e.g., Hero, Feature, CTA, etc.).

## Key Features

- **Blog Post Content Type**: Manage blog articles (title, slug, excerpt, body, image, category, date, etc.) directly from Contentful.
- **Modular Homepage Blocks**: Use a variety of content types (Hero, Feature, CTA, etc.) for flexible, reusable homepage sections.
- **SEO-Friendly**: Includes separate fields for SEO Title and SEO Description in both Page and Blog Post content types, plus a custom `` component for meta tags.
- **Dynamic Routing**: Gatsby’s `createPages` API in `gatsby-node.js` generates individual blog pages and category-based archives automatically.
- **Responsive, Accessible UI**: Styles built with **Vanilla Extract** for consistent design tokens and fluid responsiveness.

# πŸ”Œ Contentful API Integration (Postman)

- Postman allows you to quickly test and prototype Contentful API queries without writing code. You can:
- Validate content structure before frontend integration
- Debug or inspect specific entries and assets
- Preview query filters, sorting, and field selections

IN PROGRESS

## Core Technologies

- **Gatsby**: React-based static site generator for high performance and speed.
- **Contentful**: Headless CMS to store and deliver structured content.
- **GraphQL**: Query language for pulling data from Contentful.
- **Vanilla Extract**: CSS-in-JS approach for theming and design tokens.
- **Netlify**: Hosting and continuous deployment (see `netlify.toml`).
- **Node.js**: For local development scripts and Gatsby build process.

---

## Contentful Model Overview

### 1. **Blog Post**

**Fields**:

- **Slug** *(Short text, required)*
- **Title** *(Short text, required)*
- **Body** *(Rich text)*
- **Excerpt** *(Long text)*
- **Image** *(File)*
- **Date** *(Date & time)*
- **Category** *(Short text)*
- **Author** *(Reference to an Author or text)*
- **SEO Title** *(Short text, < 50 chars)*
- **SEO Description** *(Long text)*

> **Note**: The `slug` is used to generate the page URL (e.g. `/blogs/{slug}`). GraphQL queries in `gatsby-node.js` or `blog-post.js` fetch data for each post.

### 2. **Page**

**Fields**:

- **title** *(Short text)*
- **slug** *(Short text, required)*
- **description** *(Short text)*
- **Image** *(File)*
- **Body** *(Rich text)*
- **SEO Title** *(Short text, <35 chars)*
- **SEO Description** *(Long text)*

> **Note**: Typically used for top-level site pages with custom content.

### 3. **Layout & Homepage Blocks**

These content types (e.g., Homepage Hero, Feature List, CTA, LayoutHeader, LayoutFooter, etc.) are stored in Contentful and retrieved for the homepage and global site layout. They share common fields via GraphQL **interfaces**.

---

## Developer Documentation

1. **Setup**
- Copy `.env.EXAMPLE` β†’ `.env.development` & `.env.production`, fill in **Contentful** credentials:

```env
CONTENTFUL_SPACE_ID=xxxx
CONTENTFUL_ACCESS_TOKEN=xxxx
CONTENTFUL_MANAGEMENT_TOKEN=xxxx
```

- Install dependencies:

```bash
npm install
# or
yarn install
```

2. **Local Development**
- Run `npm run develop` or `yarn develop`.
- Open `http://localhost:8000` to see the site locally.
- Use `gatsby-source-contentful` for fetching data. Check `gatsby-config.mjs` for plugin options.

3. **Creating Blog Post Pages**
- In `gatsby-node.js`, we query all blog post slugs and create individual pages at build time, using the `blog-post.js` template.
- For category listings, `blog-category.js` can filter posts by a `category` field.

4. **SEO & ``**
- Use `src/components/head.js` to inject meta tags on each page or post.
- Pass `title`, `description`, and optional `image` or `url` props.

---

## Full Folder Structure (with Comments)

```bash
└── gah-code-gilbertoharosite/ # Root of the project
β”œβ”€β”€ README.md # Project readme (this file)
β”œβ”€β”€ LICENSE # License info (BSD 0-Clause)
β”œβ”€β”€ gatsby-browser.js # Gatsby browser-level APIs (fonts, global styles)
β”œβ”€β”€ gatsby-config.mjs # Main Gatsby config, includes plugins
β”œβ”€β”€ gatsby-node.js # Gatsby Node APIs for dynamic page creation
β”œβ”€β”€ netlify.toml # Netlify configuration for deployment
β”œβ”€β”€ package.json # NPM/Yarn dependencies and scripts
β”œβ”€β”€ .env.EXAMPLE # Example env variables for Contentful
β”œβ”€β”€ .nvmrc # Node version specification
β”œβ”€β”€ .prettierignore # Prettier ignore rules
β”œβ”€β”€ .prettierrc.json # Prettier configuration
└── src/ # Source code for the Gatsby site
β”œβ”€β”€ components/ # Reusable and layout components
β”‚ β”œβ”€β”€ fallback.js # Fallback component for unknown block types
β”‚ β”œβ”€β”€ head.js # SEOHead component for meta tags
β”‚ β”œβ”€β”€ sections.js # Exports homepage sections (Hero, CTA, etc.)
β”‚ β”œβ”€β”€ blog/ # Blog post-specific components
β”‚ β”‚ β”œβ”€β”€ Card.js
β”‚ β”‚ β”œβ”€β”€ PostCard.jsx
β”‚ β”‚ └── PostCardSmall.jsx
β”‚ β”œβ”€β”€ design-system/ # Vanilla Extract theming + base styles
β”‚ β”‚ β”œβ”€β”€ 404.css.ts
β”‚ β”‚ β”œβ”€β”€ about-hero.css.ts
β”‚ β”‚ β”œβ”€β”€ colors.css.ts
β”‚ β”‚ β”œβ”€β”€ skill.css.ts
β”‚ β”‚ β”œβ”€β”€ styles.css.ts
β”‚ β”‚ └── theme.css.ts
β”‚ β”œβ”€β”€ layout/ # Layout and navigation structure
β”‚ β”‚ β”œβ”€β”€ footer.js # Global footer
β”‚ β”‚ β”œβ”€β”€ hero.js # Hero layout section
β”‚ β”‚ β”œβ”€β”€ layout.js # Wraps each page with header/footer
β”‚ β”‚ β”œβ”€β”€ header/
β”‚ β”‚ β”‚ β”œβ”€β”€ header.css.ts
β”‚ β”‚ β”‚ └── header.js
β”‚ β”‚ └── navigation/
β”‚ β”‚ β”œβ”€β”€ caret.css.ts
β”‚ β”‚ β”œβ”€β”€ caret.js
β”‚ β”‚ β”œβ”€β”€ nav-item-group.css.ts
β”‚ β”‚ └── nav-item-group.js
β”‚ └── ui/ # Generic UI components (buttons, lists, etc.)
β”‚ β”œβ”€β”€ benefit-list.js
β”‚ β”œβ”€β”€ brand-logo.js
β”‚ β”œβ”€β”€ chevron-right.js
β”‚ β”œβ”€β”€ cta.js
β”‚ β”œβ”€β”€ logo-list.js
β”‚ β”œβ”€β”€ product-list.js
β”‚ β”œβ”€β”€ stat-list.js
β”‚ β”œβ”€β”€ ui.css.ts
β”‚ β”œβ”€β”€ ui.jsx
β”‚ β”œβ”€β”€ certifications/
β”‚ β”‚ β”œβ”€β”€ resume-styled-cert-list.css.ts
β”‚ β”‚ β”œβ”€β”€ resume-styled-cert-list.jsx
β”‚ β”‚ └── resume-styled-item.js
β”‚ β”œβ”€β”€ feature/
β”‚ β”‚ β”œβ”€β”€ feature-list.jsx
β”‚ β”‚ └── feature.jsx
β”‚ └── skills/
β”‚ β”œβ”€β”€ skill-list-grid.js
β”‚ └── styles.css
β”œβ”€β”€ data/
β”‚ └── certifications.json # Content data for certifications
β”œβ”€β”€ pages/ # Gatsby pages mapped to routes
β”‚ β”œβ”€β”€ 404.js # Custom 404 page
β”‚ β”œβ”€β”€ experience.js # Experience page
β”‚ β”œβ”€β”€ index.js # Homepage
β”‚ β”œβ”€β”€ learning.js # Learning page
β”‚ └── {Page.slug}.js # Dynamically created pages from Contentful
└── templates/ # Templates for dynamic page creation
β”œβ”€β”€ RichTextRenderer.js # Renders rich text fields from Contentful
β”œβ”€β”€ blog-category.js # Lists posts under specific categories
β”œβ”€β”€ blog-index.js # Main blog listing or "index" page
β”œβ”€β”€ blog-post.css.ts # Styling for single blog posts
└── blog-post.js # Template for rendering individual blog posts

```

---

## Local Development & Deployment

1. **Clone & Install**

```bash
git clone
cd gah-code-gilbertoharosite
npm install
# or
yarn install
```

2. **Environment Variables**
- Copy `.env.EXAMPLE` β†’ `.env.development` / `.env.production`
- Provide **Contentful** credentials.

3. **Develop**

```bash
npm run develop
```

or

```bash
yarn develop
```

Go to `http://localhost:8000`.

4. **Build & Serve**

```bash
npm run build && npm run serve
```

or

```bash
yarn build && yarn serve
```

5. **Deploy**
- **Netlify**: This project includes `netlify.toml` for config.
- Other hosts: Serve the `public/` folder after `gatsby build`.

---

## License

This project is licensed under **BSD Zero Clause License (0BSD)**. See [LICENSE](./LICENSE) for details.

---