Skip to content

Commit ffdc20d

Browse files
committed
feat: Add SEO enhancements, image compression, and section configuration
- Add comprehensive SEO implementation with sitemap and robots.txt - Implement image compression for assets (certificates and profile photos) - Add section configuration system with docs - Update chatbot and navbar components - Add SEO validator and sitemap generator scripts - Update translations and documentation - Configure deployment workflow and environment example
1 parent 69d3192 commit ffdc20d

34 files changed

Lines changed: 3450 additions & 241 deletions

.env.example

Lines changed: 80 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,84 @@
1-
# Environment Variables Example
2-
# Copy this file to .env and fill in your values
1+
# Portfolio Configuration Example
2+
# Copy this file to .env for local development
33

4-
# Gemini API Key (for AI Chatbot)
5-
# Get your key from: https://makersuite.google.com/app/apikey
6-
GEMINI_API_KEY=
4+
# ============================================
5+
# Section Configuration
6+
# ============================================
7+
# Control which sections appear and in what order
8+
# See docs/SECTION_CONFIGURATION.md for full documentation
79

8-
# Google Analytics 4 Measurement ID
9-
# Get your ID from: https://analytics.google.com
10-
# Format: G-XXXXXXXXXX
11-
VITE_GA_MEASUREMENT_ID=
10+
# Order of sections (comma-separated list of section IDs)
11+
# Available IDs: home, about, skills, projects, experience, education, publications, certificates, contact
12+
# VITE_SECTIONS_ORDER="home,about,skills,projects,experience,education,publications,certificates,contact"
1213

14+
# Which sections to show (comma-separated list of section IDs)
15+
# If omitted, all sections are shown
16+
# VITE_ENABLED_SECTIONS="home,about,skills,projects,experience,education,publications,certificates,contact"
17+
18+
# ============================================
1319
# Feature Flags
14-
VITE_ENABLE_CHATBOT=true
15-
VITE_ENABLE_DYNAMIC_CONTENT=true
16-
VITE_ENABLE_PERSONAS=true
17-
VITE_FORCE_DEFAULT_CONTENT=false
18-
VITE_SHOW_RECOMMENDED_SECTIONS=true
19-
20-
# Development/Debug Flags (set to false in production)
21-
VITE_SHOW_DEV_ELEMENTS=false
22-
VITE_SHOW_VISITOR_CONTROLS=false
23-
VITE_SHOW_PROFILE_INSIGHTS=false
24-
VITE_SHOW_TRANSLATION_DEBUG=false
25-
VITE_SHOW_DEBUG_INFO=false
26-
27-
# Environment
28-
NODE_ENV=development
20+
# ============================================
21+
22+
# Enable/disable personas feature
23+
# VITE_ENABLE_PERSONAS=false
24+
25+
# Enable/disable dynamic content
26+
# VITE_ENABLE_DYNAMIC_CONTENT=false
27+
28+
# Force default (non-personalized) content
29+
# VITE_FORCE_DEFAULT_CONTENT=false
30+
31+
# Enable chatbot feature
32+
# VITE_ENABLE_CHATBOT=true
33+
34+
# Show recommended sections based on user behavior
35+
# VITE_SHOW_RECOMMENDED_SECTIONS=false
36+
37+
# ============================================
38+
# Development Tools
39+
# ============================================
40+
41+
# Show development elements
42+
# VITE_SHOW_DEV_ELEMENTS=false
43+
44+
# Show visitor type controls
45+
# VITE_SHOW_VISITOR_CONTROLS=false
46+
47+
# Show profile insights panel
48+
# VITE_SHOW_PROFILE_INSIGHTS=false
49+
50+
# Show translation debug info
51+
# VITE_SHOW_TRANSLATION_DEBUG=false
52+
53+
# Show general debug information
54+
# VITE_SHOW_DEBUG_INFO=false
55+
56+
# ============================================
57+
# Analytics
58+
# ============================================
59+
60+
# Google Analytics Measurement ID
61+
# VITE_GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX
62+
63+
# ============================================
64+
# External APIs
65+
# ============================================
66+
67+
# Google Gemini API Key (for chatbot)
68+
# VITE_GEMINI_API_KEY=your-api-key-here
69+
70+
# ============================================
71+
# Example Configurations
72+
# ============================================
73+
74+
# Minimal Portfolio (only essential sections)
75+
# VITE_ENABLED_SECTIONS="home,about,projects,contact"
76+
# VITE_SECTIONS_ORDER="home,about,projects,contact"
77+
78+
# Academic Focus
79+
# VITE_SECTIONS_ORDER="home,about,publications,education,skills,projects,certificates,contact"
80+
# VITE_ENABLED_SECTIONS="home,about,publications,education,certificates,contact"
81+
82+
# Developer Portfolio
83+
# VITE_SECTIONS_ORDER="home,projects,skills,experience,about,contact"
84+
# VITE_ENABLED_SECTIONS="home,projects,skills,experience,contact"

.github/workflows/deploy.yml

Lines changed: 34 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,61 @@
1-
name: Deploy Next Branch to gh-pages
1+
name: Deploy Portfolio to GitHub Pages
22

33
on:
44
push:
5-
branches: [ next ]
5+
branches:
6+
- main
7+
- next
68
workflow_dispatch:
79

8-
# Sets permissions of the GITHUB_TOKEN to allow deployment to gh-pages branch
910
permissions:
10-
contents: write
11+
contents: read
12+
pages: write
13+
id-token: write
1114

12-
# Allow only one concurrent deployment
1315
concurrency:
14-
group: "gh-pages-deployment"
16+
group: "pages"
1517
cancel-in-progress: false
1618

1719
jobs:
18-
build-and-deploy:
20+
build:
1921
runs-on: ubuntu-latest
2022

2123
steps:
22-
- name: Checkout repository
24+
- name: Checkout
2325
uses: actions/checkout@v4
24-
with:
25-
fetch-depth: 0
26-
26+
2727
- name: Setup Node.js
2828
uses: actions/setup-node@v4
2929
with:
3030
node-version: '20'
3131
cache: 'npm'
32-
32+
3333
- name: Install dependencies
3434
run: npm ci
35-
36-
- name: Create production environment file
37-
run: |
38-
echo "# Production Environment Variables" > .env.production
39-
echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }}" >> .env.production
40-
echo "VITE_ENABLE_CHATBOT=${{ secrets.VITE_ENABLE_CHATBOT || 'true' }}" >> .env.production
41-
echo "VITE_ENABLE_DYNAMIC_CONTENT=${{ secrets.VITE_ENABLE_DYNAMIC_CONTENT || 'true' }}" >> .env.production
42-
echo "VITE_ENABLE_PERSONAS=${{ secrets.VITE_ENABLE_PERSONAS || 'true' }}" >> .env.production
43-
echo "VITE_FORCE_DEFAULT_CONTENT=${{ secrets.VITE_FORCE_DEFAULT_CONTENT || 'false' }}" >> .env.production
44-
echo "VITE_SHOW_RECOMMENDED_SECTIONS=${{ secrets.VITE_SHOW_RECOMMENDED_SECTIONS || 'true' }}" >> .env.production
45-
echo "VITE_SHOW_DEV_ELEMENTS=false" >> .env.production
46-
echo "VITE_SHOW_VISITOR_CONTROLS=false" >> .env.production
47-
echo "VITE_SHOW_PROFILE_INSIGHTS=false" >> .env.production
48-
echo "VITE_SHOW_TRANSLATION_DEBUG=false" >> .env.production
49-
echo "VITE_SHOW_DEBUG_INFO=false" >> .env.production
50-
echo "NODE_ENV=production" >> .env.production
51-
35+
5236
- name: Build project
5337
run: npm run build:prod
54-
55-
- name: Verify build output
38+
env:
39+
NODE_ENV: production
40+
41+
- name: Verify SEO files
5642
run: |
57-
if [ ! -d "dist" ]; then
58-
echo "❌ Error: dist directory not found!"
59-
exit 1
60-
fi
61-
if [ ! -f "dist/index.html" ]; then
62-
echo "❌ Error: index.html not found in dist!"
63-
exit 1
64-
fi
65-
echo "✅ Build output verified successfully"
43+
echo "Checking for SEO files..."
44+
ls -la dist/robots.txt dist/sitemap.xml dist/llms.txt || echo "Warning: Some SEO files may be missing"
6645
67-
- name: Add .nojekyll file
68-
run: touch dist/.nojekyll
69-
70-
- name: Deploy to gh-pages branch
71-
uses: peaceiris/actions-gh-pages@v4
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
7248
with:
73-
github_token: ${{ secrets.GITHUB_TOKEN }}
74-
publish_dir: ./dist
75-
publish_branch: gh-pages
76-
force_orphan: true
77-
user_name: 'github-actions[bot]'
78-
user_email: 'github-actions[bot]@users.noreply.github.com'
79-
commit_message: 'Deploy from next branch 🚀'
49+
path: './dist'
50+
51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
runs-on: ubuntu-latest
56+
needs: build
57+
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

NO_JS_FALLBACK_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Example:
276276
"@type": "Person",
277277
"name": "Khalil Charfi",
278278
"jobTitle": "Full-Stack Engineer",
279-
"email": "khalilcharfi8@gmail.com"
279+
"url": "https://khalilcharfi.github.io/"
280280
}
281281
</script>
282282
```

0 commit comments

Comments
 (0)