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
This commit is contained in:
Hamza Ahmed
2026-07-20 20:07:36 +00:00
parent 95bb2ebd2c
commit a2bb6bf982
7 changed files with 36 additions and 37 deletions
+27 -5
View File
@@ -13,10 +13,14 @@ This is a simple personal static website hosted at ahmza.dad. The site consists
### Generate HTML from Markdown
```bash
pandoc index.md -s -o index.html --css styles.css
pandoc index.md -s -o index.html --template template.html
```
This single command regenerates `index.html` from the markdown source.
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
@@ -24,6 +28,14 @@ This single command regenerates `index.html` from the markdown source.
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:
@@ -112,21 +124,31 @@ There is no error handling in this static site. If the page doesn't load:
```
ahmza-dad/
├── index.md # SOURCE - edit this file
├── index.html # GENERATED - do not edit directly
├── 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
├── 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 --css styles.css`
3. Run: `pandoc about.md -s -o about.html --template template.html`
4. Add to nginx.conf or link from existing pages
### Adding images