From b0047ab2ce51c38284646f74e6f65811842e35db Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Mon, 4 Aug 2025 22:15:17 -0400 Subject: [PATCH] Needed install instructinos for using go tool. --- README.md | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 129b450..d465556 100644 --- a/README.md +++ b/README.md @@ -6,30 +6,58 @@ SSG is a Static Site Generator that is only a Static Site Generator. No resumes here! I'll never work at Amazon, Google, or Microsoft so SSG doesn't include every single thing they've ever made. Just a piece of code that generates static files from templates for websites, and can do it live while you develop said templates. -## Planned Features Needed +## Current Features -* Simply converts dir to other dir. -* Whatever templates I'm using, and markdown. +* Simply converts dirs to other dir. +* Default Go templates, and markdown. * Watches the dir and reruns the build when there's a change. -* Simple built-in webserver to view the changes. -* Possibly template lint or html lint. +* Can also watch a `static/` directory and sync that too. + +## Possible Future Features + +* Running other generators, like Pandoc for PDFs. +* Linting your templates. * https://github.com/sourcegraph/go-template-lint * https://www.djlint.com/docs/languages/golang/ * Code highlighting -- should that prism or something else? +## Installation + +You can install it with the latest tool system: + +```shell +go get -tool git.learnjsthehardway.com/learn-code-the-hard-way/ssgod +``` + +After that you have the ability to run the tool inside your project: + +```shell +go tool ssgod +```` + ## Usage -Create a default `ssgod.toml` config: +These instructions assume you're running the tool using `go tool`. If not then, I mean, you're a +smart person right? Create a default `ssgod.toml` config: ```shell -ssgod init +go tool ssgod init ``` +You can change the config file name with the `--config` option: + +```shell +go tool ssgod --config mysite.toml init +``` + +This option is available for all commands, so if you want to init a different config file then do as +shown above. + The config assumes you have a `public/` as a target, and a `pages/` as source full of templates to render. You can change this in the config. Once you're ready run: ```shell -ssgod +go tool ssgod ``` It will render all `pages/**/*.md` and `pages/**/*.html` into the `public/` directory using the @@ -37,7 +65,7 @@ It will render all `pages/**/*.md` and `pages/**/*.html` into the `public/` dire changes and do a sync: ```shell -ssgod watch +go tool ssgod watch ``` This will watch the directory and whenever you change something it'll rebuild. It has a 500ms delay