Compare commits

...
16 Commits
Author SHA1 Message Date
ahmza 1f106f0f54 Update .gitea/workflows/deploy.yml
Deploy / deploy (push) Successful in 15s
2026-07-20 20:18:21 +00:00
Hamza Ahmed a2bb6bf982 Fix black-screen render: build with pandoc template
Deploy / deploy (push) Failing after 14s
- Convert template.html to a pandoc template ($title$/$body$)
- Update CI deploy and docs to use --template template.html
- Fix header.html title to match canonical
- Ignore generated index.html (regenerated by CI)
- Update AGENTS.md build commands and file structure
2026-07-20 20:07:36 +00:00
Hamza Ahmed 95bb2ebd2c added AGENTS.md for opencode
Deploy / deploy (push) Successful in 9s
2026-03-11 15:12:50 +00:00
Hamza Ahmed 7f75f73258 starting point to convert to pandoc template 2026-03-11 15:12:32 +00:00
Hamza Ahmed dcd4cb31ff updated to include index 2026-03-11 15:12:03 +00:00
Hamza Ahmed 0b3cd5719d updated styles 2026-03-11 15:03:48 +00:00
Hamza Ahmed c8f636bec6 Merge branch 'main' of ssh://tea.ahmza.com:2222/ahmza/ahmza-dad
Deploy / deploy (push) Successful in 11s
2026-03-11 12:15:49 +00:00
Hamza Ahmed c15a877614 updated commands to reload nginx 2026-03-11 12:15:00 +00:00
ahmza e91fc60b58 Update .gitea/workflows/deploy.yml
Deploy / deploy (push) Failing after 9s
2026-03-11 11:59:02 +00:00
Hamza Ahmed f640d2e403 attempting with scp
Deploy / deploy (push) Failing after 9s
2026-03-11 11:51:59 +00:00
Hamza Ahmed 4f5eb0e44f Rsync now uses SSH_PORT
Deploy / deploy (push) Failing after 9s
2026-03-11 11:49:19 +00:00
Hamza Ahmed b969e6a3a4 wf will also download rsync
Deploy / deploy (push) Failing after 11s
2026-03-11 11:46:04 +00:00
Hamza Ahmed 822c807505 wf will use rsync to copy files
Deploy / deploy (push) Failing after 11s
2026-03-11 11:44:40 +00:00
Hamza Ahmed 58d81decc2 wf will download the repo
Deploy / deploy (push) Failing after 11s
2026-03-11 11:38:30 +00:00
Hamza Ahmed a0bd1fa3d2 added deploy wf
Deploy / deploy (push) Failing after 10s
2026-03-11 11:33:10 +00:00
Hamza Ahmed 8f44491f99 added nginx config 2026-03-11 11:18:39 +00:00
10 changed files with 465 additions and 15 deletions
+1 -1
View File
@@ -5,5 +5,5 @@ This site is a silly basic html css webpage
Uses pandoc to generate the page.
```
pandoc index.md -s -o index.html --css styles.css
pandoc index.md -s -o index.html --template template.html
```
+38
View File
@@ -0,0 +1,38 @@
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pandoc
run: apt-get update && apt-get install -y pandoc
- name: Generate HTML
run: pandoc index.md -s -o index.html --template template.html
- name: Setup SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
echo "Key Added"
ls ~/.ssh
- name: Deploy to server via SCP
run: |
scp -P ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
index.html styles.css nginx.conf \
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/ahmza.dad/
- name: Reload nginx
run: |
ssh -p ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \
"sudo nginx -s reload || sudo systemctl reload nginx || sudo systemctl restart nginx"
+3 -1
View File
@@ -1,2 +1,4 @@
index.html
package-lock.json
# Generated by pandoc from index.md (see AGENTS.md); regenerated in CI
index.html
+174
View File
@@ -0,0 +1,174 @@
# AGENTS.md - Developer Guidelines for ahmza.dad
## Project Overview
This is a simple personal static website hosted at ahmza.dad. The site consists of:
- `index.md` - Source markdown content
- `index.html` - Generated HTML (via pandoc)
- `styles.css` - Styling (retro terminal aesthetic with lime on black)
- `nginx.conf` - Nginx server configuration
## Build Commands
### Generate HTML from Markdown
```bash
pandoc index.md -s -o index.html --template template.html
```
This single command regenerates `index.html` from the markdown source using
the custom `template.html` layout (header, menu, content, footer grid). Do NOT
use the plain `--css styles.css` form without `--template`, as pandoc's default
template omits the custom grid layout and the page will render as a near-blank
black screen.
### Development Workflow
1. Edit `index.md` to change content
2. Run the pandoc command above to regenerate HTML
3. Test locally by opening `index.html` in a browser
### Automated Deployment (CI)
Pushing to the `main` branch triggers `.gitea/workflows/deploy.yml`, which
installs pandoc, regenerates `index.html` from `index.md` using
`template.html`, then copies the artifacts to the server and reloads nginx.
Because CI regenerates `index.html`, any hand-edits to `index.html` will be
overwritten on the next push.
### Deployment
This is a static site served by nginx. The `nginx.conf` shows the configuration:
- Serves from `/usr/share/nginx/html`
- Uses `index.html` as the default index
- Has gzip compression enabled
- Caches static assets (images, CSS, JS) for 1 year
To deploy, copy the files to the nginx html directory:
```bash
# Copy files to nginx directory (adjust path as needed)
cp index.html styles.css /usr/share/nginx/html/
# Reload nginx
nginx -s reload
```
## Code Style Guidelines
### General Principles
- Keep it simple - this is a minimal static site
- No JavaScript required unless absolutely necessary
- No build tools, no frameworks
### Markdown (index.md)
- Use standard Markdown syntax
- Front matter (YAML) goes at the top between `---` delimiters
- Keep paragraphs concise and readable
- Use minimal formatting - the site doesn't need complex markdown features
### HTML (index.html)
This file is GENERATED by pandoc - DO NOT EDIT DIRECTLY. All changes should be made to `index.md` and then regenerated.
If you must hand-edit HTML:
- Use 2 spaces for indentation
- Lowercase tags and attributes
- Quote all attribute values
- Self-closing tags for void elements (`<meta />`, `<link />`, etc.)
- Keep attributes in consistent order: `class`, `id`, `src`, `alt`, `href`, etc.
### CSS (styles.css)
The existing style uses a retro terminal aesthetic:
- Background: black (`#000`)
- Text: lime green (`lime` or `#00FF00`)
- Font: Verdana/sans-serif, 14px base size
When modifying:
- Use 2 spaces for indentation
- One selector per line, properties on new lines
- Properties: value with space after colon
- Use hex colors or named colors (like `lime`)
- Group related styles together
- Keep specificity low - avoid overly specific selectors
Example:
```css
body {
background: #000;
color: lime;
}
.title {
color: lime;
padding: 10px;
}
```
### Naming Conventions
- Files: lowercase with hyphens (e.g., `styles.css`, `index.html`)
- CSS classes: lowercase with hyphens (e.g., `.title`, `.text`)
- IDs: lowercase with hyphens when needed
### Error Handling
There is no error handling in this static site. If the page doesn't load:
1. Check that `index.html` exists and is valid
2. Verify `styles.css` is linked correctly
3. Check nginx error logs: `/var/log/nginx/error.log`
## File Structure
```
ahmza-dad/
├── index.md # SOURCE - edit this file
├── index.html # GENERATED - do not edit directly (CI regenerates on push)
├── template.html # Pandoc template ($title$/$body$) - the page layout
├── header.html # Header partial (reference snippet)
├── nav.html # Menu/nav partial (reference snippet)
├── footer.html # Footer partial (reference snippet)
├── styles.css # Stylesheet
├── nginx.conf # Nginx configuration
├── .gitignore # Git ignore rules
└── .gitea/
├── README.md # Project notes
└── workflows/
└── deploy.yml # CI: regenerate HTML + deploy on push to main
```
Note: `header.html`, `nav.html`, and `footer.html` are standalone reference
snippets. The actual page layout lives in `template.html`, which is what
pandoc uses to build `index.html`.
## Common Tasks
### Adding a new page
1. Create new markdown file (e.g., `about.md`)
2. Add front matter with title
3. Run: `pandoc about.md -s -o about.html --template template.html`
4. Add to nginx.conf or link from existing pages
### Adding images
1. Place images in the same directory as `index.html`
2. Reference with relative path: `<img src="image.png" alt="description">`
3. Images are cached for 1 year per nginx.conf
### Changing the theme
Edit `styles.css`. The current theme is:
- Black background with lime green text
- Verdana font
- Centered content with padding
## Notes for Agents
- This is a very simple project - no complexity is needed
- Always edit `index.md` not `index.html` for content changes
- Run the pandoc command after any markdown changes
- No tests exist - manual verification is sufficient
- No linting configured
- Commit messages should be clear but brief
+3
View File
@@ -0,0 +1,3 @@
<div class="footer">
<p>ahmza</p>
</div>
+3
View File
@@ -0,0 +1,3 @@
<div class="header">
<h1>I want to be a dad!</h1>
</div>
+6
View File
@@ -0,0 +1,6 @@
<div class="menu">
<ul>
<li><a href="https://ahmza.dad">ahmza.dad</a></li>
<li><a href="https://blog.ahmza.com">blog.ahmza.com</a></li>
</ul>
</div>
+71
View File
@@ -0,0 +1,71 @@
# auto detects a good number of processes to run
worker_processes auto;
#Provides the configuration file context in which the directives that affect connection processing are specified.
events {
# Sets the maximum number of simultaneous connections that can be opened by a worker process.
worker_connections 1024;
# Tells the worker to accept multiple connections at a time
multi_accept on;
}
http {
# what times to include
include /etc/nginx/mime.types;
# what is the default one
default_type application/octet-stream;
# Sets the path, format, and configuration for a buffered log write
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
'"$http_referer" "$http_user_agent"';
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 9;
gzip_buffers 10 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css text/xml text/javascript image/webp image/svg+xml image/x-icon application/javascript application/x-javascript application/json application/xml application/xml+rss;
server {
# listen on port 80
listen 80;
# save logs here
access_log /var/log/nginx/access.log compression;
# where's the root dir
root /usr/share/nginx/html;
# what file to serve as index
index index.html index.htm;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to redirecting to index.html
try_files $uri $uri/ /index.html;
}
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|webp)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
# Javascript and CSS files
location ~* \.(?:css|js)$ {
try_files $uri =404;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
# Any route containing a file extension (e.g. /devicesfile.js)
location ~ ^.+\..+$ {
try_files $uri =404;
}
}
}
+129 -13
View File
@@ -1,27 +1,143 @@
body {
background: #000;
color: lime;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 14px;
* {
box-sizing: border-box;
}
.title {
body {
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 14px;
background-color: #000;
}
.grid-container {
display: grid;
grid-template-areas:
'header'
'menu'
'main'
'footer';
color: lime;
gap: 10px;
}
.header {
grid-area: header;
text-align: center;
color: lime;
}
.header>h1 {
color: lime;
padding: 10px;
margin-bottom: 10px;
text-transform: uppercase;
text-decoration: underline double grey;
text-decoration: underline double green;
}
h1 {
.menu {
grid-area: menu;
border-right: dashed;
margin-right: 10px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
}
.menu li a {
color: lime;
text-decoration: none;
}
.menu li a:hover {
color: green;
}
.content {
grid-area: main;
}
.content>h1 {
font-size: 2em;
text-align: center;
margin-bottom: 10px;
}
p {
text-align: center;
.content>p {
margin-bottom: 7px;
}
.text {
padding: 20px;
.footer {
grid-area: footer;
color: lightgrey;
text-align: center;
position: fixed;
width: 100%;
left: 0;
bottom: 0;
}
/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
.header {
grid-area: 1 / span 6;
}
.menu {
grid-area: 2 / span 1;
}
.content {
grid-area: 2 / span 4;
}
.footer {
grid-area: 4 / span 6;
}
}
/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {
body {
font-size: 18px;
}
}
/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {
.header {
grid-area: 1 / span 6;
}
.menu {
grid-area: 2 / span 1;
}
.content {
grid-area: 2 / span 4;
}
.footer {
grid-area: 3 / span 6;
}
}
/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {}
/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {}
@media (prefers-reduced-motion: reduce) {
* {
animation: none !important;
transition: none !important;
}
}
+37
View File
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>$title$</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="grid-container">
<div class="header">
<h1>$title$</h1>
</div>
<div class="menu">
<ul>
<li><a href="https://ahmza.dad">ahmza.dad</a></li>
<li><a href="https://blog.ahmza.com">blog.ahmza.com</a></li>
</ul>
</div>
<div class="content">
$body$
</div>
<div class="footer">
<p>ahmza</p>
</div>
</div>
</body>
</html>