Spaces:
Running
Running
Deploying to Hugging Face Spaces (Static HTML)
This guide explains how to deploy the presentation site to Hugging Face Spaces on port 7860.
Prerequisites
- A Hugging Face account
- Git installed on your machine
Step 1: Create a New Space
- Go to https://huggingface.co/new-space
- Enter a Space name (e.g.,
ai-powered-developer-presentation) - Select Static as the Space SDK (or "HTML" if available)
- Choose visibility (Public or Private)
- Click Create Space
Step 2: Clone the Space Repository
git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
cd YOUR_SPACE_NAME
Step 3: Copy Project Files
Copy these files into the cloned repository:
YOUR_SPACE_NAME/
βββ index.html
βββ style.css
βββ main.js
βββ icon_assets/ # Copy the entire folder
βββ chatgpt-3.svg
βββ Google_Gemini_icon_2025.svg
βββ Anthropic Symbol SVG.svg
βββ OpenAI Symbol SVG.svg
βββ X Symbol SVG.svg
βββ Vscode.svg
βββ cursor.svg
βββ antigravity.png
βββ Windsurf Icon.png
βββ kiro.svg
βββ qoder.svg
Step 4: Fix Icon Paths for Hugging Face
In index.html, change all icon paths from ../icon_assets/ to ./icon_assets/:
Find and Replace:
../icon_assets/β./icon_assets/
This is because Hugging Face serves from the root of the space.
Step 5: Commit and Push
git add .
git commit -m "Add presentation site files"
git push
Step 6: Access Your Site
Your site will be available at:
https://YOUR_USERNAME-YOUR_SPACE_NAME.hf.space
Hugging Face Spaces automatically serves static HTML on port 7860 internally.
Alternative: Using app.py (Gradio Wrapper)
If you prefer a Python wrapper, create an app.py:
import gradio as gr
from pathlib import Path
# Read the HTML file
html_content = Path("index.html").read_text()
# Simple Gradio app that serves HTML
with gr.Blocks() as demo:
gr.HTML(html_content)
demo.launch(server_port=7860)
And a requirements.txt:
gradio
Troubleshooting
| Issue | Solution |
|---|---|
| Icons not loading | Make sure paths are ./icon_assets/ (relative to root) |
| CSS/JS not loading | Verify all files are in the same directory |
| 404 errors | Check file names are exactly matching (case-sensitive) |
Quick Checklist
- Space created on Hugging Face
- Files copied to the space directory
- Icon paths updated to
./icon_assets/ - Icon folder included with all assets
- Pushed to Hugging Face
Your presentation will be live! π