generated from Cammybot/git-pages-template
Initial commit
This commit is contained in:
17
.forgejo/workflows/publish.yml
Normal file
17
.forgejo/workflows/publish.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
name: Publish Site
|
||||
on:
|
||||
push:
|
||||
branches: [main, pages]
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: codeberg-tiny
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Publish to Git-Pages
|
||||
uses: actions/git-pages@v2
|
||||
with:
|
||||
site: https://pages.ntiforo.net/${{ github.event.repository.name }}/
|
||||
password: ${{ secrets.GIT_PAGES_PASSWORD }}
|
||||
source: .index/
|
||||
33
.gitignore
vendored
Normal file
33
.gitignore
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
# OS Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
Desktop.ini
|
||||
|
||||
# Editor Files
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# Node.js
|
||||
node_modules/
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
|
||||
# Build Outputs
|
||||
dist/
|
||||
build/
|
||||
out/
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
logs/
|
||||
|
||||
# Environment
|
||||
.env
|
||||
.env.local
|
||||
|
||||
# Temporary Files
|
||||
tmp/
|
||||
temp/
|
||||
61
.index/index.html
Normal file
61
.index/index.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>${{ github.event.repository.name }}</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
||||
color: #eee;
|
||||
min-height: 100vh;
|
||||
}
|
||||
h1 {
|
||||
color: #e94560;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
p {
|
||||
margin-bottom: 1rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.card {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 10px;
|
||||
padding: 1.5rem;
|
||||
margin: 1rem 0;
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
a {
|
||||
color: #e94560;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.emoji {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="emoji">🌟</div>
|
||||
<h1>${{ github.event.repository.name }}</h1>
|
||||
<div class="card">
|
||||
<p>Welcome to your Git-Pages site!</p>
|
||||
<p>This site is automatically deployed from this repository.</p>
|
||||
</div>
|
||||
<p>📁 Edit <code>.index/index.html</code> to customize this page.</p>
|
||||
<p>🔄 Push to <code>main</code> or <code>pages</code> to auto-deploy.</p>
|
||||
</body>
|
||||
</html>
|
||||
90
README.md
Normal file
90
README.md
Normal file
@@ -0,0 +1,90 @@
|
||||
# Git-Pages Template
|
||||
|
||||
This repository is a template for deploying static sites to your Git-Pages server at `pages.ntiforo.net`.
|
||||
|
||||
## 🚀 How It Works
|
||||
|
||||
1. **Use this template** to create a new repository
|
||||
2. **Push your static site** to the `.index/` directory
|
||||
3. **Forgejo Action** automatically deploys on push to `main` or `pages`
|
||||
4. **Your site is live** at `https://pages.ntiforo.net/<repo-name>/`
|
||||
|
||||
## 📁 Structure
|
||||
|
||||
```
|
||||
.
|
||||
├── .forgejo/
|
||||
│ └── workflows/
|
||||
│ └── publish.yml # Auto-deployment workflow
|
||||
├── .index/
|
||||
│ └── index.html # Your site contents
|
||||
├── README.md # This file
|
||||
└── .gitignore # Git ignore rules
|
||||
```
|
||||
|
||||
## 🛠️ Setup
|
||||
|
||||
### 1. Create Repository from Template
|
||||
|
||||
Click **"Use this template"** → Create new repository
|
||||
|
||||
### 2. Add Secret
|
||||
|
||||
Go to: **Settings → Secrets → Actions → New secret**
|
||||
|
||||
- **Name:** `GIT_PAGES_PASSWORD`
|
||||
- **Value:** Your git-pages server password
|
||||
|
||||
### 3. Push Your Site
|
||||
|
||||
Replace `.index/index.html` with your content, then:
|
||||
|
||||
```bash
|
||||
git add .
|
||||
git commit -m "Initial site"
|
||||
git push origin main
|
||||
```
|
||||
|
||||
## 📝 Customization
|
||||
|
||||
### Add More Pages
|
||||
|
||||
Create additional HTML files in `.index/`:
|
||||
|
||||
```
|
||||
.index/
|
||||
├── index.html # Homepage (https://pages.ntiforo.net/repo/)
|
||||
├── about.html # About page (https://pages.ntiforo.net/repo/about.html)
|
||||
└── css/
|
||||
└── styles.css # Custom styles
|
||||
```
|
||||
|
||||
### Update Workflow
|
||||
|
||||
Edit `.forgejo/workflows/publish.yml` to:
|
||||
- Change the site URL
|
||||
- Add build steps (e.g., for static site generators)
|
||||
- Customize deployment behavior
|
||||
|
||||
## 🔐 Security
|
||||
|
||||
- Keep `GIT_PAGES_PASSWORD` secret secure
|
||||
- Only push to trusted repositories
|
||||
- Consider using forge token authorization instead of password (see git-pages docs)
|
||||
|
||||
## 🎯 Examples
|
||||
|
||||
- Single page site: Just use `.index/index.html`
|
||||
- Multi-page site: Add more HTML files to `.index/`
|
||||
- Static site generator: Add build step, output to `.index/`
|
||||
|
||||
## 📚 Resources
|
||||
|
||||
- [Git-Pages Documentation](https://git-pages.org)
|
||||
- [Git-Pages Action](https://codeberg.org/git-pages/action)
|
||||
- [Git-Pages CLI](https://codeberg.org/git-pages/git-pages-cli)
|
||||
|
||||
---
|
||||
|
||||
**Created by:** Cammy 💦
|
||||
**Date:** 2026-04-01
|
||||
Reference in New Issue
Block a user