Skip to content

Repository files navigation

Portfolio Site

Deploy Hugo site to GitHub Pages GitHub Pages Hugo License: MIT

LinkedIn GitHub followers GitHub stars

Maintenance Website GitHub last commit GitHub repo size

A personal portfolio website built with Hugo static site generator and automatically deployed to GitHub Pages.

πŸš€ Live Site

Visit the live site at: https://martincarapia.github.io/

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

Installing Hugo

macOS (using Homebrew):

brew install hugo

Windows (using Chocolatey):

choco install hugo-extended

Linux (using Snap):

sudo snap install hugo

πŸ› οΈ Local Development

1. Clone the Repository

git clone https://github.com/martincarapia/martincarapia.github.io.git
cd martincarapia.github.io

2. Install Dependencies

If using Hugo modules or themes with dependencies:

hugo mod download

3. Run Development Server

Start the local development server:

hugo server

Or with draft content and live reload:

hugo server --buildDrafts --buildFuture --disableFastRender

The site will be available at http://localhost:1313

4. Build for Production

Generate static files for production:

hugo --minify

The generated files will be in the public/ directory.

πŸ“ Project Structure

β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml          # GitHub Actions deployment workflow
β”œβ”€β”€ archetypes/
β”‚   └── default.md              # Content templates
β”œβ”€β”€ assets/                     # Sass files, JS, images for processing
β”œβ”€β”€ content/
β”‚   β”œβ”€β”€ _index.md              # Homepage content
β”‚   β”œβ”€β”€ about.md               # About page
β”‚   └── blogs/                 # Blog posts
β”œβ”€β”€ data/                      # Data files (YAML, JSON, TOML)
β”œβ”€β”€ layouts/                   # HTML templates
β”œβ”€β”€ static/                    # Static files (images, CSS, JS)
β”œβ”€β”€ themes/                    # Hugo themes
β”œβ”€β”€ hugo.yaml                  # Hugo configuration
└── .gitignore                # Git ignore rules

πŸ“ Content Management

Creating New Content

Create a new blog post:

hugo new content/blogs/my-new-post.md

Create a new page:

hugo new content/my-new-page.md

Front Matter Example

---
title: "My Awesome Post"
date: 2023-12-01T10:00:00Z
draft: false
description: "A brief description of the post"
tags: ["hugo", "web development"]
categories: ["blog"]
---

Your content here...

🎨 Customization

Configuration

Main site configuration is in hugo.yaml. Key settings:

baseURL: 'https://martincarapia.github.io/'
languageCode: 'en-us'
title: 'My Portfolio Site'
theme: 'your-theme'

params:
  author: 'Your Name'
  description: 'Your site description'

Styling

  • Custom CSS: Add files to assets/css/
  • Images: Place in static/images/
  • JavaScript: Add to assets/js/

πŸš€ Deployment

This site uses GitHub Actions for automatic deployment to GitHub Pages.

Automatic Deployment

Every push to the main branch automatically:

  1. Builds the Hugo site
  2. Deploys to GitHub Pages
  3. Makes the site live at https://martincarapia.github.io/

Manual Deployment

You can also trigger deployment manually:

  1. Go to the "Actions" tab in your GitHub repository
  2. Select "Deploy Hugo site to GitHub Pages"
  3. Click "Run workflow"

πŸ”§ Development Workflow

1. Create a new branch for changes

git checkout -b feature/new-feature

2. Make your changes

  • Edit content in content/
  • Modify layouts in layouts/
  • Update styles in assets/

3. Test locally

hugo server --buildDrafts

4. Commit and push

git add .
git commit -m "Add new feature"
git push origin feature/new-feature

5. Create a Pull Request

  • Open a PR on GitHub
  • Review changes
  • Merge to main for automatic deployment

πŸ“Š Analytics & SEO

Google Analytics

Add your GA4 measurement ID in hugo.yaml:

googleAnalytics: 'G-XXXXXXXXXX'

SEO Optimization

  • Set proper title and description in front matter
  • Use descriptive filenames and URLs
  • Optimize images (use WebP when possible)
  • Generate sitemap automatically with Hugo

πŸ› Troubleshooting

Common Issues

Hugo server not starting:

# Check Hugo version
hugo version

# Clear Hugo cache
hugo mod clean

Build failing in GitHub Actions:

  • Check the Actions tab for detailed error logs
  • Ensure all required files are committed
  • Verify Hugo version compatibility

Styles not loading:

  • Check file paths in templates
  • Ensure CSS files are in the correct directory
  • Clear browser cache

Getting Help

πŸ“„ License

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

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ž Contact

About

My Portfolio Site

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages