Skip to content

tthheusalmeida/tthheusalmeida.github.io

Repository files navigation

Matheus Almeida - Portfolio & Blog

Deploy to GitHub Pages

Personal portfolio and blog developed with Astro, React, and Tailwind CSS, featuring multilingual support (PT/EN) and advanced search and navigation features.

🌐 View live site

πŸ“‹ Table of Contents

🎯 About the Project

This is a personal website and blog built with modern web technologies. The project was developed with a focus on performance, accessibility, and user experience, using Astro as the main framework and React for interactive components.

✨ Features

Blog

  • πŸ“ Complete blog system with Markdown support
  • 🌍 Multilingual support (Portuguese and English)
  • 🏷️ Tag system for post categorization
  • πŸ“… Date organization with folder structure by year/month/day
  • πŸ” Real-time search with optimized search index
  • πŸ“– Estimated reading time for each post
  • πŸ“‘ Table of contents (TOC) automatically generated
  • πŸ”— Related posts based on tags
  • πŸ“° RSS feed for subscribers
  • πŸ—ΊοΈ Sitemap for SEO

Interface

  • 🎨 Design system based on shadcn/ui
  • πŸŒ“ Light/dark mode with smooth transitions
  • πŸ“± Responsive design for all devices
  • β™Ώ Accessibility following best practices
  • 🎯 Sidebar navigation with section links
  • πŸ” Scroll to top button for easier navigation
  • 🎨 Code highlighting with GitHub Dark theme

Internationalization

  • 🌐 Complete i18n system with PT/EN translations
  • πŸ”„ Persistent language toggle
  • πŸ“ Automatic fallback for untranslated posts
  • πŸ—“οΈ Localized date formatting

Search and Navigation

  • πŸ”Ž Advanced search bar with filters
  • 🏷️ Search by tags and title
  • ⚑ Optimized performance with pre-computed index
  • 🎯 Relevant results per language

πŸ›  Technologies Used

Core

  • Astro (v5.18.0) - Web framework for content
  • React (v18.3.1) - Library for interactive components
  • TypeScript - Static typing

Styling

Functionality

Astro Integrations

Testing

DevOps

  • GitHub Actions - Automated CI/CD
  • GitHub Pages - Static hosting

πŸ“ Project Structure

tthheusalmeida.github.io/
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml           # Automatic deployment workflow
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ favicon.ico             # Site favicon
β”‚   └── favicon.svg             # Vector favicon
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/             # React components
β”‚   β”‚   β”œβ”€β”€ ui/                # Base UI components (shadcn/ui)
β”‚   β”‚   β”‚   └── button.tsx
β”‚   β”‚   β”œβ”€β”€ AsideNav.tsx       # Sidebar navigation
β”‚   β”‚   β”œβ”€β”€ BlogFooter.tsx     # Blog footer
β”‚   β”‚   β”œβ”€β”€ BlogHome.tsx       # Blog home page
β”‚   β”‚   β”œβ”€β”€ BlogPostToc.tsx    # Table of contents
β”‚   β”‚   β”œβ”€β”€ Header.tsx         # Site header
β”‚   β”‚   β”œβ”€β”€ RelatedPosts.tsx   # Related posts
β”‚   β”‚   └── SearchBar.tsx      # Search bar
β”‚   β”œβ”€β”€ content/               # Site content
β”‚   β”‚   β”œβ”€β”€ blog/             # Blog posts organized by date
β”‚   β”‚   β”‚   └── 2025/01/01/
β”‚   β”‚   β”‚       β”œβ”€β”€ welcome.en.md
β”‚   β”‚   β”‚       └── welcome.pt.md
β”‚   β”‚   └── blog.test.ts      # Schema tests
β”‚   β”œβ”€β”€ layouts/              # Site layouts
β”‚   β”‚   β”œβ”€β”€ BaseLayout.astro  # Base layout
β”‚   β”‚   └── Layout.astro      # Post layout
β”‚   β”œβ”€β”€ lib/                  # Utilities and functions
β”‚   β”‚   β”œβ”€β”€ i18n.ts          # Internationalization
β”‚   β”‚   β”œβ”€β”€ readingTime.ts   # Reading time calculation
β”‚   β”‚   β”œβ”€β”€ relatedPosts.ts  # Related posts logic
β”‚   β”‚   β”œβ”€β”€ search.ts        # Post search
β”‚   β”‚   β”œβ”€β”€ searchIndex.ts   # Search index
β”‚   β”‚   β”œβ”€β”€ useLang.ts       # Language hook
β”‚   β”‚   └── utils.ts         # General utilities
β”‚   β”œβ”€β”€ pages/               # Site pages
β”‚   β”‚   β”œβ”€β”€ blog/
β”‚   β”‚   β”‚   └── [...slug].astro  # Dynamic post page
β”‚   β”‚   β”œβ”€β”€ index.astro          # Home page
β”‚   β”‚   └── rss.xml.ts          # RSS feed
β”‚   β”œβ”€β”€ schemas/             # Validation schemas
β”‚   β”‚   └── blog.ts         # Blog schema
β”‚   β”œβ”€β”€ styles/             # Global styles
β”‚   β”œβ”€β”€ test/               # Test configuration
β”‚   β”œβ”€β”€ content.config.ts   # Content configuration
β”‚   └── env.d.ts           # TypeScript types
β”œβ”€β”€ astro.config.mjs        # Astro configuration
β”œβ”€β”€ components.json         # shadcn/ui configuration
β”œβ”€β”€ package.json           # Project dependencies
β”œβ”€β”€ tailwind.config.mjs    # Tailwind configuration
β”œβ”€β”€ tsconfig.json         # TypeScript configuration
β”œβ”€β”€ vitest.config.ts      # Testing configuration
β”œβ”€β”€ .gitignore           # Git ignored files
β”œβ”€β”€ LICENSE              # MIT License
└── README.md           # This file

πŸš€ Installation and Setup

Prerequisites

  • Node.js 20 or higher
  • npm or another package manager

Installation steps

  1. Clone the repository:
git clone https://github.com/tthheusalmeida/tthheusalmeida.github.io.git
cd tthheusalmeida.github.io
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev
  1. Open your browser at http://localhost:4321

πŸ“œ Available Commands

Command Description
npm run dev Starts the development server
npm run start Alias for npm run dev
npm run build Generates production build in dist/
npm run preview Preview production build locally
npm test Runs all tests with Vitest

πŸ’» Development

Adding a New Post

  1. Create a .md file in src/content/blog/YYYY/MM/DD/
  2. Add the frontmatter:
---
title: "Post Title"
draft: false
slug: "post-title"
date: 2025-01-01
lang: "en"  # or "pt"
tags: ["tag1", "tag2"]
---

Post content in Markdown...
  1. For multilingual posts, create .pt.md and .en.md versions

Adding UI Components

Components follow the shadcn/ui pattern. To add new components:

  1. Create the component in src/components/ui/
  2. Use Tailwind classes and CVA for variants
  3. Export the component

Testing

Each component has its corresponding test file (.test.tsx or .test.ts). Tests use:

  • Vitest as test runner
  • Testing Library for component testing
  • jsdom for DOM environment

Run tests with:

npm test

πŸš€ Deployment

The project is automatically deployed to GitHub Pages via GitHub Actions whenever there's a push to the main branch.

Deployment Workflow

The .github/workflows/deploy.yml file contains the CI/CD configuration that:

  1. βœ… Checks out the code
  2. βš™οΈ Sets up Node.js 20
  3. πŸ“¦ Installs dependencies
  4. πŸ—οΈ Builds the project
  5. πŸ“€ Uploads the artifact
  6. πŸš€ Deploys to GitHub Pages

Manual Deployment

You can also deploy manually:

  1. Build the project:
npm run build
  1. The content will be in dist/ ready to be served

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


Developed by Matheus Almeida πŸ’™

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors