Creating a portfolio website is an excellent way to showcase your skills and projects to potential employers or clients. One popular platform for hosting a portfolio website is GitHub, which allows you to create a static website using HTML, CSS, and JavaScript. In this guide, we'll walk you through the process of creating a portfolio website on GitHub using these web development languages, along with some source code examples.

Before we dive into the creation process, let's briefly discuss why GitHub is an ideal platform for hosting your portfolio. GitHub offers a user-friendly interface, easy collaboration features, and built-in version control. Additionally, it provides a free, custom domain for your portfolio website, making it easily accessible to anyone with an internet connection.

Setting Up Your GitHub Portfolio Repository
To get started, you'll need to create a new repository on GitHub for your portfolio website. This repository will serve as the central hub for your project, where you can store, manage, and share your code. To create a new repository, follow these steps:

1. Log in to your GitHub account and click on the '+' icon in the top-right corner of the screen.
2. Select 'New repository' from the dropdown menu.

3. Name your repository 'yourusername.github.io', replacing 'yourusername' with your actual GitHub username. This naming convention is crucial for GitHub Pages to recognize your repository as a website.
4. Click on the 'Create repository' button to create your new repository.
Understanding GitHub Pages

GitHub Pages is a static site hosting service provided by GitHub. It allows you to publish your website directly from your GitHub repository. To enable GitHub Pages for your portfolio website, follow these steps:
1. Navigate to your 'yourusername.github.io' repository.
2. Click on the 'Settings' tab at the top of the repository.

3. Scroll down to the 'GitHub Pages' section and select the 'main' branch as the source.
4. Click 'Save' to enable GitHub Pages for your repository.




















Structuring Your Portfolio Website
Now that your GitHub Pages are set up, it's time to structure your portfolio website. Create the following files and folders in your 'yourusername.github.io' repository:
- index.html: The main landing page of your portfolio website.
- about.html: A page dedicated to sharing information about yourself and your skills.
- projects.html: A page showcasing your projects with descriptions and links to the source code.
- css: A folder containing your CSS stylesheets (e.g., styles.css).
- js: A folder containing your JavaScript files (e.g., script.js).
Creating Your Portfolio Website
Now that your repository is structured, let's create the content for your portfolio website. We'll provide some source code examples to help you get started.
index.html
The index.html file will serve as the main landing page of your portfolio website. Here's a basic structure to get you started:
```html
Your Name
Welcome to My Portfolio
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero...
```
In this example, we've included a basic header with a navigation menu and a main section with a welcome message. You can customize this structure to fit your specific needs.
Adding CSS Styles
To style your portfolio website, create a new file called styles.css in the css folder. Here's an example of how you can style the basic structure of your portfolio website:
```css body { font-family: Arial, sans-serif; margin: 0; padding: 0; background-color: #f4f4f4; } header { background-color: #333; color: #fff; padding: 20px; display: flex; justify-content: space-between; align-items: center; } nav ul { list-style-type: none; margin: 0; padding: 0; display: flex; } nav ul li { margin-left: 20px; } nav ul li a { color: #fff; text-decoration: none; padding: 5px 10px; transition: background-color 0.3s ease; } nav ul li a:hover { background-color: #555; } main { max-width: 960px; margin: auto; padding: 20px; } h1, h2 { color: #333; } ```
This CSS code will apply basic styling to your portfolio website, including a dark header with a navigation menu and centered content in the main section. You can further customize this styling to match your personal brand or preferences.
Adding Interactivity with JavaScript
To add interactivity to your portfolio website, create a new file called script.js in the js folder. Here's an example of how you can add a simple hover effect to your navigation menu using JavaScript:
```javascript const navLinks = document.querySelectorAll('nav ul li a'); navLinks.forEach((link) => { link.addEventListener('mouseover', () => { link.style.backgroundColor = '#555'; }); link.addEventListener('mouseout', () => { link.style.backgroundColor = '#333'; }); }); ```
This JavaScript code will add a hover effect to your navigation menu, changing the background color of the links when the user hovers over them.
Expanding Your Portfolio Website
Now that you have the basic structure of your portfolio website set up, you can expand it by adding more pages and features. Here are some ideas to help you grow your portfolio:
About Page
Create an about.html page to share information about yourself, your skills, and your experiences. You can include a personal bio, a list of your technical skills, and any relevant work experience or projects. Don't forget to add appropriate headings and paragraphs to structure your content effectively.
Projects Page
Create a projects.html page to showcase your projects with descriptions and links to the source code. You can use a combination of headings, paragraphs, and unordered lists to display your projects in an organized and engaging manner. Make sure to include a brief description of each project, the technologies used, and a link to the project's GitHub repository or live demo.
Blog or Articles
Consider adding a blog or articles section to your portfolio website to demonstrate your writing skills and share your knowledge with others. You can create new HTML files for each blog post and link to them from your main navigation menu. Don't forget to include relevant headings, paragraphs, and any necessary images or code snippets to support your content.
Contact Form
Add a contact form to your portfolio website to allow visitors to get in touch with you. You can use a simple HTML form with input fields for the user's name, email address, and message. To ensure that the form works correctly, you'll need to set up a backend service to process the form submissions. Alternatively, you can use a third-party service like Formspree or Wufoo to handle the form submissions for you.
Creating a portfolio website on GitHub using HTML, CSS, and JavaScript is an excellent way to showcase your skills and projects to potential employers or clients. By following the steps outlined in this guide, you'll have a professional and engaging portfolio website that demonstrates your unique value as a web developer. Don't be afraid to customize your portfolio website to match your personal brand or preferences, and always strive to improve and expand your content to better showcase your skills and experiences.
Now that you have the knowledge and tools to create a stunning portfolio website, it's time to put your skills into action. Start by creating the basic structure of your portfolio website, and then expand it with additional pages and features as you become more comfortable with the development process. With dedication and hard work, you'll soon have a portfolio website that you're proud to share with the world.