Skip to content

Commit fde0f03

Browse files
committed
Create GitHub Pages documentation site (fixes #35)
Built an academic paper-style landing page with personality: Design & Style: - Academic paper aesthetic with serif typography (Crimson Pro) - Monospace code blocks (JetBrains Mono) - Clean, professional layout with numbered sections - Burnt orange accent color for character - Paper-like background with subtle shadows - Print-friendly styles Features: - 🔍 Interactive search across examples - 🏷️ Category filtering (LLM & AI, Security, Web Scraping, etc.) - 📊 Statistics dashboard (example count, categories) - 🎨 Responsive design for all devices - 🎯 Direct links to GitHub repository - 📖 Citation-style footer Technical: - Built with Astro for fast static site generation - Auto-deployment via GitHub Actions - Organized example catalog with tags and descriptions - SEO-friendly meta tags Personality Touches: - Konami code easter egg (↑↑↓↓←→←→BA) - Academic citation format - Clean terminal-style title with $ prompt - Curated example descriptions Documentation: - Added docs/README.md with development guide - Included setup and contribution instructions Closes #35
1 parent fec3ed7 commit fde0f03

File tree

11 files changed

+901
-0
lines changed

11 files changed

+901
-0
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
cache: 'npm'
29+
cache-dependency-path: docs/package-lock.json
30+
31+
- name: Setup Pages
32+
uses: actions/configure-pages@v4
33+
34+
- name: Install dependencies
35+
run: cd docs && npm install
36+
37+
- name: Build site
38+
run: cd docs && npm run build
39+
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: ./dist
44+
45+
deploy:
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
runs-on: ubuntu-latest
50+
needs: build
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ It is a way for me to remember and hopefully get others started.
99

1010
Start your Python journey in Python 3. Onward and upward.
1111

12+
**📚 [View the documentation site →](https://james-see.github.io/python-examples/)**
13+
1214
## 🚀 Quick Start
1315

1416
This project uses [uv](https://github.com/astral-sh/uv) for modern Python package management.

docs/.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
dist/
6+
.astro/
7+
8+
# Environment
9+
.env
10+
.env.local
11+
12+
# IDE
13+
.vscode/
14+
.idea/
15+
16+
# OS
17+
.DS_Store
18+
Thumbs.db
19+
20+
# Logs
21+
*.log
22+
npm-debug.log*

docs/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Python Examples Documentation Site
2+
3+
This is the source for the GitHub Pages documentation site for python-examples.
4+
5+
## 🚀 Built With
6+
7+
- **Astro** - Fast, content-focused static site generator
8+
- **Academic Paper Design** - Clean, professional typography inspired by research papers
9+
- **Interactive Filtering** - Search and filter examples by category
10+
- **Personality** - Easter eggs and touches that show character
11+
12+
## 🛠️ Development
13+
14+
```bash
15+
cd docs
16+
17+
# Install dependencies
18+
npm install
19+
20+
# Start dev server
21+
npm run dev
22+
23+
# Build for production
24+
npm run build
25+
26+
# Preview production build
27+
npm run preview
28+
```
29+
30+
## 📁 Structure
31+
32+
```
33+
docs/
34+
├── src/
35+
│ ├── layouts/ # Page layouts
36+
│ ├── pages/ # Astro pages
37+
│ ├── styles/ # Global CSS
38+
│ └── components/ # Reusable components (future)
39+
├── public/ # Static assets
40+
└── astro.config.mjs # Astro configuration
41+
```
42+
43+
## 🎨 Design Philosophy
44+
45+
- **Academic aesthetic** - Serif fonts, paper-like background, numbered sections
46+
- **Monospace code** - JetBrains Mono for all code examples
47+
- **Accent color** - Burnt orange (#d35400) for personality
48+
- **Clean typography** - Crimson Pro for body, Inter for UI elements
49+
- **Interactive** - Search, filters, and easter eggs for engagement
50+
51+
## 🚀 Deployment
52+
53+
The site automatically deploys to GitHub Pages when changes are pushed to master via GitHub Actions.
54+
55+
## 🎯 Features
56+
57+
- ✅ Responsive design
58+
- ✅ Search functionality
59+
- ✅ Category filtering
60+
- ✅ Print-friendly (for actual paper)
61+
- ✅ Easter egg (Konami code)
62+
- ✅ Fast static site generation
63+
- ✅ Academic paper styling
64+
65+
## 📝 Adding New Examples
66+
67+
Edit `src/pages/index.astro` and add to the `examples` array:
68+
69+
```javascript
70+
{
71+
title: 'your-example.py',
72+
description: 'What it does',
73+
category: 'Category Name',
74+
tags: ['tag1', 'tag2'],
75+
difficulty: 'beginner' // or 'intermediate', 'advanced'
76+
}
77+
```
78+
79+
The site will automatically update filters and search.

docs/astro.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from 'astro/config';
2+
3+
export default defineConfig({
4+
site: 'https://james-see.github.io',
5+
base: '/python-examples',
6+
outDir: '../dist',
7+
build: {
8+
assets: '_assets'
9+
}
10+
});

docs/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "python-examples-docs",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"scripts": {
6+
"dev": "astro dev",
7+
"build": "astro build",
8+
"preview": "astro preview"
9+
},
10+
"dependencies": {
11+
"astro": "^4.16.18"
12+
}
13+
}

docs/public/favicon.svg

Lines changed: 4 additions & 0 deletions
Loading

docs/src/layouts/Layout.astro

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
interface Props {
3+
title: string;
4+
}
5+
6+
const { title } = Astro.props;
7+
---
8+
9+
<!doctype html>
10+
<html lang="en">
11+
<head>
12+
<meta charset="UTF-8" />
13+
<meta name="description" content="A curated collection of Python examples for modern development" />
14+
<meta name="viewport" content="width=device-width" />
15+
<link rel="icon" type="image/svg+xml" href="/python-examples/favicon.svg" />
16+
<meta name="generator" content={Astro.generator} />
17+
<title>{title}</title>
18+
</head>
19+
<body>
20+
<div class="paper-container">
21+
<slot />
22+
</div>
23+
<style is:global>
24+
@import "../styles/global.css";
25+
</style>
26+
</body>
27+
</html>

0 commit comments

Comments
 (0)