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
- About the Project
- Features
- Technologies Used
- Project Structure
- Installation and Setup
- Available Commands
- Development
- Testing
- Deployment
- License
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.
- π 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
- π¨ 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
- π Complete i18n system with PT/EN translations
- π Persistent language toggle
- π Automatic fallback for untranslated posts
- ποΈ Localized date formatting
- π Advanced search bar with filters
- π·οΈ Search by tags and title
- β‘ Optimized performance with pre-computed index
- π― Relevant results per language
- Astro (v5.18.0) - Web framework for content
- React (v18.3.1) - Library for interactive components
- TypeScript - Static typing
- Tailwind CSS (v3.4.13) - Utility-first CSS framework
- shadcn/ui - Reusable UI components
- Lucide React - Modern icons
- @tailwindcss/typography - Content styles
- Astro Content Collections - Content management
- Zod - Schema validation
- gray-matter - Frontmatter parser
- class-variance-authority - Component variants
- clsx & tailwind-merge - CSS class management
- @astrojs/react - React integration
- @astrojs/tailwind - Tailwind integration
- @astrojs/sitemap - Sitemap generation
- @astrojs/rss - RSS feed
- Vitest (v4.0.18) - Testing framework
- @testing-library/react - React component testing
- @testing-library/jest-dom - Custom matchers
- @testing-library/user-event - User interaction simulation
- jsdom - DOM environment for testing
- GitHub Actions - Automated CI/CD
- GitHub Pages - Static hosting
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
- Node.js 20 or higher
- npm or another package manager
- Clone the repository:
git clone https://github.com/tthheusalmeida/tthheusalmeida.github.io.git
cd tthheusalmeida.github.io- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser at
http://localhost:4321
| 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 |
- Create a
.mdfile insrc/content/blog/YYYY/MM/DD/ - 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...- For multilingual posts, create
.pt.mdand.en.mdversions
Components follow the shadcn/ui pattern. To add new components:
- Create the component in
src/components/ui/ - Use Tailwind classes and CVA for variants
- Export the component
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 testThe project is automatically deployed to GitHub Pages via GitHub Actions whenever there's a push to the main branch.
The .github/workflows/deploy.yml file contains the CI/CD configuration that:
- β Checks out the code
- βοΈ Sets up Node.js 20
- π¦ Installs dependencies
- ποΈ Builds the project
- π€ Uploads the artifact
- π Deploys to GitHub Pages
You can also deploy manually:
- Build the project:
npm run build- The content will be in
dist/ready to be served
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by Matheus Almeida π