Welcome to AI-Powered Web Development!

A Visual Guide to Installing Gemini in VS Code and Building Your First Website

Part 1: Setting Up Your Developer Toolkit

Step 1: Install VS Code

VS Code is your code editor. It's where you'll write the code for your websites.

  1. Open your browser and go to code.visualstudio.com.
  2. Click the big blue "Download" button.
  3. Run the installer you downloaded.
  4. Follow the setup instructions, keeping the default settings.
Visual Studio Code download page

Part 2: Bringing Gemini into VS Code

Step 2: Find the Gemini Extension

Now let's add the Gemini AI assistant to VS Code.

  1. Click the Extensions icon on the left-side Activity Bar.
  2. In the search bar, type Gemini.
  3. Look for the one published by Google.
  4. Alternatively, go to Gemini Code Assist and install.
  5. Click the blue Install button.
  6. After installation, click the new Gemini icon in the Activity Bar.
  7. Click the button to sign in with your Google account.
  8. Follow the browser prompts to authorize access.
Searching for Gemini in VS Code Extensions
Signing in to Gemini

Step 3: Install & Sign In

  1. Create an empty folder on your desktop.
  2. Drag and drop it into the middle section of VS Code.
  3. Authorize the editor to access the folder.

Part 3: Generating Your First Website

Step 4: Create Your Files

Every website needs files. Let's make ours.

  1. Go to File > Open Folder and create a new folder for your project.
  2. In the Explorer panel, right-click and select "New File".
  3. Create index.html.
  4. Create style.css.
File explorer showing index.html and style.css

Step 5: Talk to Gemini

Open the Gemini chat (Ctrl+Shift+I) and use these prompts, one for each file.

File explorer showing index.html and style.cssGemini chat prompt example

For index.html:

Generate the HTML for a simple personal portfolio website. It should have a header with my name, a section about me, a section for my projects with three placeholder projects, and a footer with my contact information. Make sure to link to a stylesheet named "style.css".

For style.css:

Generate the CSS for the personal portfolio website. Give it a clean and modern look. Use a dark theme with a readable font. Style the header, the "about me" section, the project cards, and the footer.

Gemini will generate the code. Click Insert at Cursor to add it to the correct open file.


File explorer showing index.html and style.css

Step 6: See Your Website!

Time to see your creation.

  1. Install the Live Server extension from the marketplace.
  2. Make sure you save the files.
  3. Right-click your index.html file.
  4. Select Open with Live Server.
  5. Your browser will open with your new website!
Open with live server option

Step 7: Customize and Admire!

Your website is live! Now, go back to index.html and replace the placeholder text with your own info.

Final portfolio website

CHALLENGE: Add SEO to your website

Optimize Your Website for Search Engines

Make your website more discoverable by adding these SEO elements:

  1. Add meaningful meta tags in your <head> section:
    <meta name="description" content="Your website description here">
    <meta name="keywords" content="your, keywords, here">
    <meta name="author" content="Your Name">
  2. Use semantic HTML tags like <article>, <section>, and <nav>
  3. Add descriptive alt text to all images
  4. Create a sitemap.xml file
  5. Add Open Graph tags for better social media sharing:
    <meta property="og:title" content="Your Title">
    <meta property="og:description" content="Your Description">
    <meta property="og:image" content="path/to/image.jpg">

Test Your SEO

Verify your optimizations using these tools:

  1. Google Search Console
  2. Lighthouse in Chrome DevTools
  3. Meta Tag Analyzer
  4. Mobile-Friendly Test

Remember: Good SEO combines technical optimization with quality content that provides value to your visitors.