Skip to content

Commit ccdec56

Browse files
committed
Add GitHub Pages website for libxev-http
- Create modern responsive website with homepage, API docs, and examples - Add comprehensive documentation and deployment guides - Include GitHub Actions workflow for automatic deployment - Features: responsive design, code highlighting, copy buttons, SEO optimization - Ready for GitHub Pages deployment with Jekyll configuration
1 parent e878c49 commit ccdec56

File tree

15 files changed

+3173
-0
lines changed

15 files changed

+3173
-0
lines changed

.github/workflows/pages.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# GitHub Pages deployment workflow for libxev-http
2+
name: Deploy GitHub Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main"]
8+
paths: ["docs/**"]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
21+
concurrency:
22+
group: "pages"
23+
cancel-in-progress: false
24+
25+
jobs:
26+
# Build job
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Ruby
34+
uses: ruby/setup-ruby@v1
35+
with:
36+
ruby-version: '3.1'
37+
bundler-cache: true
38+
working-directory: docs
39+
40+
- name: Setup Pages
41+
id: pages
42+
uses: actions/configure-pages@v4
43+
44+
- name: Install dependencies
45+
run: |
46+
cd docs
47+
gem install bundler
48+
bundle install
49+
50+
- name: Build with Jekyll
51+
run: |
52+
cd docs
53+
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
54+
env:
55+
JEKYLL_ENV: production
56+
57+
- name: Upload artifact
58+
uses: actions/upload-pages-artifact@v3
59+
with:
60+
path: docs/_site
61+
62+
# Deployment job
63+
deploy:
64+
environment:
65+
name: github-pages
66+
url: ${{ steps.deployment.outputs.page_url }}
67+
runs-on: ubuntu-latest
68+
needs: build
69+
steps:
70+
- name: Deploy to GitHub Pages
71+
id: deployment
72+
uses: actions/deploy-pages@v4

GITHUB_PAGES_SETUP.md

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
# GitHub Pages Setup Guide
2+
3+
This guide will help you set up GitHub Pages for the libxev-http project.
4+
5+
## 🚀 Quick Deployment Steps
6+
7+
### 1. Enable GitHub Pages
8+
9+
1. Go to your GitHub repository
10+
2. Click the **Settings** tab
11+
3. Find **Pages** in the left sidebar
12+
4. Under **Build and deployment**:
13+
- **Source**: Select "Deploy from a branch"
14+
- **Branch**: Choose **main** branch and **/docs** folder
15+
- Click **Save**
16+
17+
**Note**: GitHub Pages now uses GitHub Actions to execute Jekyll builds. Make sure GitHub Actions is enabled in your repository.
18+
19+
### 2. Update Configuration
20+
21+
Edit the `docs/_config.yml` file and update the following:
22+
23+
```yaml
24+
url: "https://YOUR-USERNAME.github.io"
25+
baseurl: "/libxev-http" # or your repository name
26+
repository: "YOUR-USERNAME/libxev-http"
27+
```
28+
29+
Replace `YOUR-USERNAME` with your actual GitHub username.
30+
31+
### 3. Update HTML Links
32+
33+
Replace all instances of `your-username` with your actual GitHub username in:
34+
35+
- `docs/index.html`
36+
- `docs/api.html`
37+
- `docs/examples.html`
38+
39+
Search and replace:
40+
```html
41+
<!-- Before -->
42+
<a href="https://github.com/your-username/libxev-http">
43+
44+
<!-- After -->
45+
<a href="https://github.com/YOUR-USERNAME/libxev-http">
46+
```
47+
48+
### 4. Update robots.txt
49+
50+
Edit `docs/robots.txt`:
51+
52+
```
53+
User-agent: *
54+
Allow: /
55+
56+
Sitemap: https://YOUR-USERNAME.github.io/libxev-http/sitemap.xml
57+
```
58+
59+
## 🔧 Custom Configuration
60+
61+
### Custom Domain (Optional)
62+
63+
If you have a custom domain:
64+
65+
1. Create `docs/CNAME` file:
66+
```
67+
libxev-http.yourdomain.com
68+
```
69+
70+
2. Configure DNS records:
71+
```
72+
CNAME libxev-http.yourdomain.com YOUR-USERNAME.github.io
73+
```
74+
75+
3. Update `_config.yml`:
76+
```yaml
77+
url: "https://libxev-http.yourdomain.com"
78+
baseurl: ""
79+
```
80+
81+
### Custom Styling
82+
83+
Edit `docs/style.css` to customize colors and styles:
84+
85+
```css
86+
:root {
87+
--primary-color: #f7931e; /* Primary color */
88+
--secondary-color: #2563eb; /* Secondary color */
89+
--accent-color: #10b981; /* Accent color */
90+
}
91+
```
92+
93+
### Add Google Analytics (Optional)
94+
95+
Add to `docs/_config.yml`:
96+
97+
```yaml
98+
google_analytics: UA-XXXXXXXX-X
99+
```
100+
101+
## 📁 File Structure
102+
103+
```
104+
docs/
105+
├── index.html # Homepage
106+
├── api.html # API documentation
107+
├── examples.html # Code examples
108+
├── style.css # Stylesheet
109+
├── script.js # JavaScript functionality
110+
├── _config.yml # Jekyll configuration
111+
├── Gemfile # Ruby dependencies
112+
├── robots.txt # Search engine configuration
113+
├── manifest.json # PWA configuration
114+
├── 404.html # Custom 404 page
115+
├── sitemap.xml # Site map
116+
└── README.md # Documentation
117+
```
118+
119+
## 🚀 自动部署
120+
121+
### GitHub Actions Workflow
122+
123+
The project includes a GitHub Actions workflow (`.github/workflows/pages.yml`) that automatically deploys when:
124+
125+
- Pushing to the main branch
126+
- Changes are made to the `docs/` directory
127+
- Manually triggering the workflow
128+
129+
### Deployment Options
130+
131+
**Option 1: Use GitHub Actions (Recommended)**
132+
- Automatic Jekyll build and deployment
133+
- Support for custom plugins and themes
134+
- Better build error reporting
135+
136+
**Option 2: Deploy Static Files Directly**
137+
If you want to bypass Jekyll processing:
138+
1. Rename `docs/.nojekyll.example` to `docs/.nojekyll`
139+
2. Remove or rename `_config.yml` and `Gemfile`
140+
3. GitHub Pages will serve HTML files directly
141+
142+
## 🌐 Access Your Website
143+
144+
After deployment, your website will be available at:
145+
146+
```
147+
https://YOUR-USERNAME.github.io/libxev-http/
148+
```
149+
150+
## 🎨 Website Features
151+
152+
### Responsive Design
153+
- Mobile-friendly navigation
154+
- Responsive grid layouts
155+
- Touch-friendly interactions
156+
157+
### Interactive Features
158+
- Copy-to-clipboard for code examples
159+
- Smooth scrolling navigation
160+
- Animated elements on scroll
161+
162+
### SEO Optimized
163+
- Social sharing meta tags
164+
- Structured data
165+
- Automatic sitemap generation
166+
167+
### Performance Optimized
168+
- Compressed CSS and JavaScript
169+
- Optimized asset loading
170+
- Fast loading times
171+
172+
## 🔍 Local Development
173+
174+
If you want to preview the website locally:
175+
176+
1. Install Ruby and Bundler
177+
2. Navigate to docs directory:
178+
```bash
179+
cd docs
180+
```
181+
3. Install dependencies:
182+
```bash
183+
bundle install
184+
```
185+
4. Start local server:
186+
```bash
187+
bundle exec jekyll serve
188+
```
189+
5. Visit `http://localhost:4000` in your browser
190+
191+
## 🐛 Troubleshooting
192+
193+
### Site Not Loading
194+
- Check GitHub Pages settings
195+
- Verify `_config.yml` syntax
196+
- Check for build errors in Actions tab
197+
198+
### Broken Links
199+
- Update all internal links to use relative paths
200+
- Check external links periodically
201+
- Use proper baseurl configuration
202+
203+
### Styling Issues
204+
- Clear browser cache
205+
- Check CSS syntax
206+
- Verify file paths
207+
208+
## 📚 Useful Resources
209+
210+
- [GitHub Pages Documentation](https://docs.github.com/en/pages)
211+
- [Jekyll Documentation](https://jekyllrb.com/docs/)
212+
- [Markdown Guide](https://www.markdownguide.org/)
213+
214+
## 🤝 Contributing
215+
216+
To contribute to the website:
217+
218+
1. Fork the repository
219+
2. Make changes in the `docs/` directory
220+
3. Test locally if possible
221+
4. Submit a Pull Request
222+
223+
## ✅ Deployment Checklist
224+
225+
- [ ] Enable GitHub Pages
226+
- [ ] Ensure GitHub Actions is enabled
227+
- [ ] Update URL and repository info in `_config.yml`
228+
- [ ] Replace all `your-username` in HTML files
229+
- [ ] Update sitemap URL in `robots.txt`
230+
- [ ] Test all links and functionality
231+
- [ ] Check mobile responsiveness
232+
- [ ] Verify SEO meta tags
233+
- [ ] Test 404 page functionality
234+
- [ ] Check HTTPS is working properly
235+
236+
After completing these steps, your libxev-http project will have a professional GitHub Pages website!

docs/.nojekyll.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file can be renamed to .nojekyll to bypass Jekyll processing
2+
#
3+
# If you want to deploy static HTML files without Jekyll processing:
4+
# 1. Rename this file to .nojekyll
5+
# 2. Remove or rename _config.yml and Gemfile
6+
# 3. GitHub Pages will serve the HTML files directly
7+
#
8+
# This is useful if you want to use a different static site generator
9+
# or serve plain HTML files without any processing.

0 commit comments

Comments
 (0)