Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

Personal Website

My personal website built with Gatsby

This is my personal website/portfolio built using Gatsby, a modern static site generator for React.

⚡ Features

  • ✅ Fast performance with Gatsby
  • ✅ Modern React-based architecture
  • ✅ Responsive design
  • ✅ Easy content management
  • ✅ Image optimization with Gatsby Image
  • ✅ Offline support with service workers

🚀 Getting Started

Prerequisites

  • Node.js >= 16.0.0
  • npm >= 7.0.0
  • Git

Installation

# Clone the repository
git clone https://github.com/st3vk/website.git
cd website
# Install dependencies
npm install

Development

# Start development server
npm run develop
# or
npm start

Your site will be available at http://localhost:8000

Build for Production

# Build optimized production bundle
npm run build
# Serve the production build locally
npm run serve

The production-ready site will be in the public/ directory.

📁 Project Structure

website/
├── src/ # Source files
│ ├── pages/ # Page components
│ │ ├── index.js # Home page
│ │ ├── 404.js # 404 page
│ │ └── ... # Other pages
│ ├── components/ # Reusable components
│ │ └── layout.css # Layout styles
│ └── images/ # Static images
├── gatsby-config.js # Gatsby configuration
├── gatsby-node.js # Gatsby Node APIs
├── gatsby-browser.js # Gatsby Browser APIs
├── gatsby-ssr.js # Gatsby SSR APIs
├── package.json # npm configuration
├── .gitignore # Git ignore rules
├── .prettierrc # Prettier configuration
├── .prettierignore # Prettier ignore rules
└── README.md # This file

📝 Adding Content

Creating a New Page

  1. Create a new file in src/pages/
  2. Export a React component as default
// src/pages/about.js
import React from "react"
const AboutPage = () => (
 <div>
 <h1>About Me</h1>
 <p>This is my about page.</p>
 </div>
)
export default AboutPage

Adding Images

  1. Add your image to src/images/
  2. Import and use it in your component
import { graphql } from "gatsby"
import Img from "gatsby-plugin-image"
// In your component
<Img 
 image={data.file.childImageSharp.gatsbyImageData} 
 alt="Description" 
/>
// In your GraphQL query
export const query = graphql`
 query {
 file(relativePath: { eq: "images/my-image.jpg" }) {
 childImageSharp {
 gatsbyImageData(width: 500)
 }
 }
 }
`

🎨 Customization

Site Metadata

Edit gatsby-config.js to update your site metadata:

module.exports = {
 siteMetadata: {
 title: `My Website`,
 description: `My personal website`,
 author: `Your Name`,
 siteUrl: `https://yourwebsite.com`,
 },
 // ...
}

Styling

  • Global styles: src/components/layout.css
  • Component-specific styles: Create .module.css files
  • Use CSS Modules for scoped styles

🔒 Security Best Practices

Keep dependencies updated - Regularly run npm update and npm audit

Environment variables - Use .env files for sensitive configuration

HTTPS - Always deploy with HTTPS enabled

Content Security Policy - Configure CSP headers in your hosting

Input validation - Validate all user inputs and form submissions

📦 Deployment

GitHub Pages

npm run build
# Deploy the public folder to GitHub Pages

Netlify

  1. Connect your GitHub repository
  2. Set build command: npm run build
  3. Set publish directory: public
  4. Deploy!

Vercel

# Install Vercel CLI
npm install -g vercel
# Deploy
vercel

Gatsby Cloud

For the best Gatsby experience, use Gatsby Cloud.

📜 License

This project is MIT licensed. See LICENSE for details.

🤝 Contributing

This is a personal project, but contributions are welcome!

🙏 Acknowledgments


Happy coding!

About

The default Gatsby starter

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /