This document explains how command pages work in the dbatools website.
URL: https://dbatools.io/commands
What it does: Shows a searchable, filterable grid of ALL commands
Files:
- Template:
themes/dbatools2025/layouts/page/commands.html - CSS:
static/css/commands-page.css - JS:
static/js/commands-page.js - Data:
static/commands.json
URL: https://dbatools.io/Add-DbaAgDatabase
What it does: Shows documentation for a single command with sidebar navigation
Files:
- Template:
themes/dbatools2025/layouts/commands/single.html - CSS:
static/css/command-single.css(sidebar, layout, filters)static/css/command-docs.css(article content styling)
- Data:
static/commands.json(used by sidebar JS)
Hugo automatically uses layouts/commands/single.html for individual command pages because:
- Content files are in
content/commands/*.md - Hugo looks for
layouts/commands/single.htmlfirst - If not found, it would fall back to
layouts/_default/single.html
- ❌
layouts/page/command-detail.html- NOT USED - ❌
static/css/command-detail.css- NOT USED
To edit the commands listing page:
- Modify:
themes/dbatools2025/layouts/page/commands.html - CSS:
static/css/commands-page.css - JS:
static/js/commands-page.js
To edit individual command pages:
- Modify:
themes/dbatools2025/layouts/commands/single.html - CSS:
static/css/command-single.cssorstatic/css/command-docs.css - No separate JS file (inline in template)
# Restart Hugo server
npm run dev
# Then hard refresh browser (Ctrl+Shift+R)# For Tailwind changes:
npm run build:css
# For regular CSS changes (command-single.css, commands-page.css, etc.):
# Just hard refresh browser (Ctrl+Shift+R)
# Hugo dev server auto-reloads static files# Just hard refresh browser (Ctrl+Shift+R)
# Hugo dev server auto-reloads static files| Page Type | Template | CSS | JS |
|---|---|---|---|
/commands listing |
page/commands.html |
commands-page.css |
commands-page.js |
| Individual command | commands/single.html |
command-single.csscommand-docs.css |
Inline in template |
- commands-page.css: Grid layout, command cards, filters for listing page
- command-single.css: Sidebar, search, filters for individual command pages (NO SCROLLBAR)
- command-docs.css: Article content (headings, code blocks, tables) for individual command pages