Skip to content

Commit e953cea

Browse files
committed
Initial commit: Zig Index website with registry submodule
0 parents  commit e953cea

File tree

110 files changed

+22089
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+22089
-0
lines changed

.env.example

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# GitHub Personal Access Token (Optional but recommended)
2+
# =====================================================
3+
# Without a token, GitHub API allows 60 requests/hour
4+
# With a token, you get 5,000 requests/hour
5+
#
6+
# How to get your GitHub token:
7+
# 1. Go to https://github.com/settings/tokens
8+
# 2. Click "Generate new token (classic)"
9+
# 3. Give it a name like "zig-index"
10+
# 4. Select scopes: "public_repo" (read-only access to public repos)
11+
# 5. Click "Generate token"
12+
# 6. Copy the token and paste it below
13+
#
14+
# For fine-grained tokens (recommended):
15+
# 1. Go to https://github.com/settings/tokens?type=beta
16+
# 2. Click "Generate new token"
17+
# 3. Set expiration and description
18+
# 4. Under "Repository access", select "Public Repositories (read-only)"
19+
# 5. Under "Permissions" > "Repository permissions":
20+
# - Metadata: Read-only
21+
# 6. Click "Generate token"
22+
#
23+
# IMPORTANT: Never commit your actual .env file to git!
24+
25+
GITHUB_TOKEN=your_github_token_here

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
repository_dispatch:
7+
types: [registry-updated]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
submodules: recursive
27+
fetch-depth: 0
28+
29+
- name: Setup Bun
30+
uses: oven-sh/setup-bun@v2
31+
with:
32+
bun-version: latest
33+
34+
- name: Install dependencies
35+
run: bun install
36+
37+
- name: Build
38+
run: bun run build
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
41+
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: ./dist
46+
47+
deploy:
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
runs-on: ubuntu-latest
52+
needs: build
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store
22+
23+
# jetbrains setting folder
24+
.idea/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "src/registry"]
2+
path = src/registry
3+
url = https://github.com/Zig-Index/registry.git

.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

CONTRIBUTING.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Contributing to Zig Index
2+
3+
Thank you for your interest in contributing to Zig Index! This guide will help you add your Zig project to the registry.
4+
5+
## Adding Your Project
6+
7+
Project submissions are made to the **registry repository**, not this website repository:
8+
9+
📦 **Registry**: https://github.com/Zig-Index/registry
10+
11+
### Prerequisites
12+
13+
Your project should:
14+
- Be related to the Zig programming language
15+
- Have a public GitHub repository
16+
- Include a README with description and usage instructions
17+
- Have a license file
18+
19+
### Step 1: Fork the Registry
20+
21+
```bash
22+
git clone https://github.com/YOUR_USERNAME/registry.git
23+
cd registry
24+
```
25+
26+
### Step 2: Create a JSON File
27+
28+
Create a new file in the appropriate directory:
29+
30+
- **Libraries/Packages**: `repositories/packages/your-package.json`
31+
- **Applications/Tools**: `repositories/applications/your-app.json`
32+
33+
### Step 3: Add Your Project Info
34+
35+
```json
36+
{
37+
"name": "Your Package Name",
38+
"owner": "github-username",
39+
"repo": "repository-name",
40+
"description": "A brief description of what your project does",
41+
"homepage": "https://your-docs-site.com",
42+
"license": "MIT",
43+
"topics": ["networking", "async", "io"]
44+
}
45+
```
46+
47+
#### Required Fields
48+
49+
| Field | Description |
50+
|-------|-------------|
51+
| `name` | Display name for your project |
52+
| `owner` | GitHub username or organization |
53+
| `repo` | Repository name (not the full URL) |
54+
| `description` | Short description (max 200 characters recommended) |
55+
56+
#### Optional Fields
57+
58+
| Field | Description |
59+
|-------|-------------|
60+
| `homepage` | Documentation or project website URL |
61+
| `license` | SPDX license identifier (e.g., "MIT", "Apache-2.0") |
62+
| `topics` | Array of relevant tags for categorization |
63+
64+
### Step 4: Submit a Pull Request
65+
66+
1. Commit your changes
67+
2. Push to your fork
68+
3. Open a Pull Request to the registry repository
69+
70+
## Contributing to the Website
71+
72+
For website improvements:
73+
74+
1. Fork https://github.com/Zig-Index/website
75+
2. Create a feature branch
76+
3. Make your changes
77+
4. Submit a Pull Request
78+
79+
### Development Setup
80+
81+
```bash
82+
# Clone with submodules
83+
git clone --recurse-submodules https://github.com/Zig-Index/website.git
84+
cd website
85+
86+
# Install dependencies
87+
npm install
88+
89+
# Start dev server
90+
npm run dev
91+
```
92+
93+
## Guidelines
94+
95+
### Topics/Tags
96+
97+
Use existing topics when possible. Common ones include:
98+
99+
- `networking`, `async`, `io` - Network and I/O related
100+
- `gui`, `ui`, `graphics` - User interface
101+
- `gamedev`, `game-engine` - Game development
102+
- `compiler`, `parser` - Language tools
103+
- `database`, `storage` - Data persistence
104+
- `testing`, `debugging` - Development tools
105+
- `learning`, `tutorial` - Educational resources
106+
107+
### Description Best Practices
108+
109+
- Keep it concise (under 200 characters)
110+
- Describe what the project does, not what it is
111+
- Include key features or use cases
112+
- Avoid marketing language
113+
114+
## Questions?
115+
116+
- Open an issue on [GitHub](https://github.com/Zig-Index/website/issues)
117+
- Check the [FAQ](https://zig-index.github.io/how-to-add)
118+
119+
Thank you for contributing to the Zig ecosystem! 🚀

README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Zig Index
2+
3+
A curated registry for discovering Zig packages and applications.
4+
5+
**[Live Site](https://zig-index.github.io)** · **[Add Your Project](https://zig-index.github.io/how-to-add)** · **[Registry](https://github.com/Zig-Index/registry)**
6+
7+
## Features
8+
9+
- 📦 **Curated Registry** - Quality-focused collection of Zig projects
10+
-**Fast** - Static site with on-demand GitHub stats
11+
- 🔍 **Search & Filter** - Find packages by topic, license, or text search
12+
- 💾 **Aggressive Caching** - Stats cached client-side for fast repeat visits
13+
-**Live Stats** - Stars, forks, and watchers from GitHub
14+
- 🎨 **Dark Mode** - Beautiful light and dark themes
15+
- 📱 **Responsive** - Works great on all devices
16+
17+
## Repository Structure
18+
19+
This is the main website repository. The registry data is maintained separately:
20+
21+
- **Website**: https://github.com/Zig-Index/website (this repo)
22+
- **Registry**: https://github.com/Zig-Index/registry (submodule at `src/registry`)
23+
24+
## Add Your Project
25+
26+
To add your project to Zig Index:
27+
28+
1. Fork the [registry repository](https://github.com/Zig-Index/registry)
29+
2. Create a JSON file in `repositories/packages/` or `repositories/applications/`
30+
3. Submit a Pull Request
31+
32+
See the [registry README](https://github.com/Zig-Index/registry) for details.
33+
34+
### JSON Schema
35+
36+
```json
37+
{
38+
"name": "your-package-name",
39+
"owner": "github-username",
40+
"repo": "repo-name",
41+
"description": "Brief description",
42+
"homepage": "https://docs-url.com",
43+
"license": "MIT",
44+
"topics": ["networking", "async"]
45+
}
46+
```
47+
48+
## Development
49+
50+
### Prerequisites
51+
52+
- Node.js 18+
53+
- npm or pnpm
54+
55+
### Setup
56+
57+
```bash
58+
# Clone with submodules
59+
git clone --recurse-submodules https://github.com/Zig-Index/website.git
60+
cd website
61+
62+
# Or if already cloned, initialize submodules
63+
git submodule update --init --recursive
64+
65+
# Install dependencies
66+
npm install
67+
68+
# Start dev server
69+
npm run dev
70+
71+
# Build for production
72+
npm run build
73+
```
74+
75+
### Environment Variables
76+
77+
Create a `.env` file (see `.env.example`):
78+
79+
```env
80+
# Optional: GitHub token for higher API rate limits
81+
# Get one at https://github.com/settings/tokens
82+
GITHUB_TOKEN=your_github_token_here
83+
```
84+
85+
## Tech Stack
86+
87+
- [Astro](https://astro.build) - Static site generator
88+
- [React](https://react.dev) - UI components
89+
- [Tailwind CSS](https://tailwindcss.com) - Styling
90+
- [TanStack Query](https://tanstack.com/query) - Data fetching & caching
91+
- [Framer Motion](https://framer.com/motion) - Animations
92+
- [Fuse.js](https://fusejs.io) - Fuzzy search
93+
94+
## License
95+
96+
MIT License - see [LICENSE](LICENSE) file.
97+
98+
## Links
99+
100+
- **Website**: https://zig-index.github.io
101+
- **Registry**: https://github.com/Zig-Index/registry
102+
- **Zig Language**: https://ziglang.org

astro.config.mjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import react from '@astrojs/react';
4+
import mdx from '@astrojs/mdx';
5+
import partytown from '@astrojs/partytown';
6+
import sitemap from '@astrojs/sitemap';
7+
import tailwindcss from '@tailwindcss/vite';
8+
9+
import markdoc from '@astrojs/markdoc';
10+
11+
// https://astro.build/config
12+
export default defineConfig({
13+
site: 'https://zig-index.github.io',
14+
output: 'static',
15+
16+
integrations: [
17+
react(),
18+
mdx(),
19+
partytown(),
20+
sitemap(),
21+
markdoc(),
22+
],
23+
24+
vite: {
25+
plugins: [tailwindcss()],
26+
resolve: {
27+
alias: {
28+
'@': '/src',
29+
},
30+
},
31+
},
32+
});

0 commit comments

Comments
 (0)