aboutsummaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2025-12-27 06:44:59 -0500
committerEugene Triguba <hello@eugenetriguba.com>2025-12-27 06:44:59 -0500
commit93670740c05def63ae4b02c99eb49391f663ff38 (patch)
tree77bbd8d664622154155fc06e2c4228cfac4fec04 /man
parentAdd license (diff)
downloadssg-93670740c05def63ae4b02c99eb49391f663ff38.zip
Add initial version of ssg
Diffstat (limited to 'man')
-rw-r--r--man/ssg-build.159
-rw-r--r--man/ssg-help.132
-rw-r--r--man/ssg-init.145
-rw-r--r--man/ssg-serve.145
-rw-r--r--man/ssg-templates.583
-rw-r--r--man/ssg-version.111
-rw-r--r--man/ssg.150
7 files changed, 325 insertions, 0 deletions
diff --git a/man/ssg-build.1 b/man/ssg-build.1
new file mode 100644
index 0000000..0ba504f
--- /dev/null
+++ b/man/ssg-build.1
@@ -0,0 +1,59 @@
+.TH SSG-BUILD 1 "December 2025" "ssg" "User Commands"
+.SH NAME
+ssg-build \- build the site
+.SH SYNOPSIS
+.B ssg build
+.RI [ options ]
+.SH DESCRIPTION
+Build the static site by rendering templates with data and copying static files.
+.PP
+Templates are processed using Go's html/template package. See
+.BR ssg-templates (5)
+for template syntax and available functions.
+.SH OPTIONS
+.TP
+.BI \-data " dir"
+Data directory containing JSON files. Default: data
+.TP
+.BI \-templates " dir"
+Templates directory containing HTML files. Default: templates
+.TP
+.BI \-static " dir"
+Static files directory. Default: static
+.TP
+.BI \-out " dir"
+Output directory. Default: dist
+.TP
+.B \-q
+Quiet mode. Only show errors.
+.SH EXAMPLES
+Build a site:
+.PP
+.RS
+.nf
+$ ssg build
+.fi
+.RE
+.PP
+Build to a custom output directory:
+.PP
+.RS
+.nf
+$ ssg build -out=public
+.fi
+.RE
+.PP
+Build with custom directories:
+.PP
+.RS
+.nf
+$ ssg build -data=content -templates=layouts -out=public
+.fi
+.RE
+.SH SEE ALSO
+.BR ssg-templates (5),
+.BR ssg-serve (1)
+.SH SSG
+Part of the
+.BR ssg (1)
+suite.
diff --git a/man/ssg-help.1 b/man/ssg-help.1
new file mode 100644
index 0000000..92f0d01
--- /dev/null
+++ b/man/ssg-help.1
@@ -0,0 +1,32 @@
+.TH SSG-HELP 1 "December 2025" "ssg" "User Commands"
+.SH NAME
+ssg-help \- show manual page
+.SH SYNOPSIS
+.B ssg help
+.RI [ command ]
+.SH DESCRIPTION
+Open the manual page for a command.
+.PP
+If no command is specified, opens the main
+.BR ssg (1)
+page.
+.SH EXAMPLES
+Show main documentation:
+.PP
+.RS
+.nf
+$ ssg help
+.fi
+.RE
+.PP
+Show build command documentation:
+.PP
+.RS
+.nf
+$ ssg help build
+.fi
+.RE
+.SH SSG
+Part of the
+.BR ssg (1)
+suite.
diff --git a/man/ssg-init.1 b/man/ssg-init.1
new file mode 100644
index 0000000..0f9db65
--- /dev/null
+++ b/man/ssg-init.1
@@ -0,0 +1,45 @@
+.TH SSG-INIT 1 "December 2025" "ssg" "User Commands"
+.SH NAME
+ssg-init \- initialize a new site
+.SH SYNOPSIS
+.B ssg init
+.RI [ directory ]
+.SH DESCRIPTION
+Create a new site with the standard directory structure:
+.PP
+.RS
+.nf
+data/
+templates/
+static/
+.fi
+.RE
+.PP
+If no directory is specified, initializes in the current directory.
+A sample
+.I templates/index.html
+is created if one does not exist.
+.SH EXAMPLES
+Initialize in the current directory:
+.PP
+.RS
+.nf
+$ ssg init
+.fi
+.RE
+.PP
+Initialize a new site:
+.PP
+.RS
+.nf
+$ ssg init mysite
+$ cd mysite
+$ ssg build
+.fi
+.RE
+.SH SEE ALSO
+.BR ssg-build (1)
+.SH SSG
+Part of the
+.BR ssg (1)
+suite.
diff --git a/man/ssg-serve.1 b/man/ssg-serve.1
new file mode 100644
index 0000000..15d8a3c
--- /dev/null
+++ b/man/ssg-serve.1
@@ -0,0 +1,45 @@
+.TH SSG-SERVE 1 "December 2025" "ssg" "User Commands"
+.SH NAME
+ssg-serve \- serve the site locally
+.SH SYNOPSIS
+.B ssg serve
+.RI [ options ]
+.SH DESCRIPTION
+Start a local HTTP server to preview the built site.
+.SH OPTIONS
+.TP
+.BI \-dir " dir"
+Directory to serve. Default: dist
+.TP
+.BI \-addr " address"
+Address to listen on. Default: :8080
+.SH EXAMPLES
+Serve the default output directory:
+.PP
+.RS
+.nf
+$ ssg serve
+.fi
+.RE
+.PP
+Serve on a different port:
+.PP
+.RS
+.nf
+$ ssg serve -addr=:3000
+.fi
+.RE
+.PP
+Build and serve:
+.PP
+.RS
+.nf
+$ ssg build && ssg serve
+.fi
+.RE
+.SH SEE ALSO
+.BR ssg-build (1)
+.SH SSG
+Part of the
+.BR ssg (1)
+suite.
diff --git a/man/ssg-templates.5 b/man/ssg-templates.5
new file mode 100644
index 0000000..2f1dbd6
--- /dev/null
+++ b/man/ssg-templates.5
@@ -0,0 +1,83 @@
+.TH SSG-TEMPLATES 5 "December 2025" "ssg" "File Formats"
+.SH NAME
+ssg-templates \- ssg template format
+.SH DESCRIPTION
+ssg templates use Go's
+.B html/template
+syntax. Each HTML file in the templates directory is processed and rendered
+to the output directory with the same filename.
+.SH DATA
+Data from JSON files in the data directory is made available to templates.
+Each file becomes a template variable named after the file (without the
+.I .json
+extension).
+.PP
+For example, if
+.I data/projects.json
+contains:
+.PP
+.RS
+.nf
+[
+ {"name": "foo", "url": "https://example.com/foo", "featured": true},
+ {"name": "bar", "url": "https://example.com/bar", "featured": false}
+]
+.fi
+.RE
+.PP
+It can be accessed in templates as
+.BR .projects :
+.PP
+.RS
+.nf
+{{range .projects}}
+ <li><a href="{{.url}}">{{.name}}</a></li>
+{{end}}
+.fi
+.RE
+.SH FUNCTIONS
+.SS filter
+The
+.B filter
+function returns items from an array where a field equals a value.
+.PP
+.RS
+.nf
+{{range filter .projects "featured" true}}
+ <li>{{.name}}</li>
+{{end}}
+.fi
+.RE
+.PP
+This would output only "foo" since it has
+.B featured
+set to
+.BR true .
+.SH SYNTAX
+Templates use Go's text/template syntax:
+.TP
+.B {{.field}}
+Output a field value.
+.TP
+.B {{range .items}}...{{end}}
+Iterate over a list.
+.TP
+.B {{if .condition}}...{{end}}
+Conditional rendering.
+.TP
+.B {{with .object}}...{{end}}
+Set dot to the object for the block.
+.PP
+See the Go
+.B html/template
+documentation for full syntax details.
+.SH FILES
+.TP
+.I data/*.json
+JSON data files. Each becomes a template variable.
+.TP
+.I templates/*.html
+HTML templates to render.
+.SH SEE ALSO
+.BR ssg (1),
+.BR ssg-build (1)
diff --git a/man/ssg-version.1 b/man/ssg-version.1
new file mode 100644
index 0000000..d5af6b6
--- /dev/null
+++ b/man/ssg-version.1
@@ -0,0 +1,11 @@
+.TH SSG-VERSION 1 "December 2025" "ssg" "User Commands"
+.SH NAME
+ssg-version \- print version
+.SH SYNOPSIS
+.B ssg version
+.SH DESCRIPTION
+Print the ssg version and exit.
+.SH SSG
+Part of the
+.BR ssg (1)
+suite.
diff --git a/man/ssg.1 b/man/ssg.1
new file mode 100644
index 0000000..a2d0621
--- /dev/null
+++ b/man/ssg.1
@@ -0,0 +1,50 @@
+.TH SSG 1 "December 2025" "ssg" "User Commands"
+.SH NAME
+ssg \- a tiny static site generator
+.SH SYNOPSIS
+.B ssg
+.I command
+.RI [ options ]
+.SH DESCRIPTION
+.B ssg
+is a minimal static site generator that reads JSON data files and renders
+Go templates to produce static HTML. Static assets are copied unchanged
+to the output directory.
+.SH COMMANDS
+.TP
+.BR ssg-build (1)
+Build the site.
+.TP
+.BR ssg-serve (1)
+Start a local HTTP server.
+.TP
+.BR ssg-init (1)
+Initialize a new site.
+.TP
+.BR ssg-version (1)
+Print the version.
+.TP
+.BR ssg-help (1)
+Show help for a command.
+.SH FILES
+.TP
+.I data/
+JSON data files. Each file becomes a template variable.
+.TP
+.I templates/
+HTML template files.
+.TP
+.I static/
+Static files copied unchanged.
+.TP
+.I dist/
+Default output directory.
+.SH SEE ALSO
+.BR ssg-build (1),
+.BR ssg-serve (1),
+.BR ssg-init (1),
+.BR ssg-version (1),
+.BR ssg-help (1),
+.BR ssg-templates (5)
+.SH AUTHOR
+Eugene Triguba <hello@eugenetriguba.com>