|
|
|
@ -5,17 +5,18 @@ import ( |
|
|
|
_ "embed" |
|
|
|
_ "embed" |
|
|
|
"flag" |
|
|
|
"flag" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"github.com/fsnotify/fsnotify" |
|
|
|
|
|
|
|
"github.com/yuin/goldmark" |
|
|
|
|
|
|
|
"io" |
|
|
|
"io" |
|
|
|
"io/fs" |
|
|
|
"io/fs" |
|
|
|
"lcthw.dev/go/ssgod/config" |
|
|
|
|
|
|
|
"log" |
|
|
|
"log" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"path/filepath" |
|
|
|
"path/filepath" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"text/template" |
|
|
|
"text/template" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/fsnotify/fsnotify" |
|
|
|
|
|
|
|
"github.com/yuin/goldmark" |
|
|
|
|
|
|
|
"lcthw.dev/go/ssgod/config" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
//go:embed example/.ssgod.json
|
|
|
|
//go:embed example/.ssgod.json
|
|
|
|
@ -33,12 +34,12 @@ func (meta *PageMetaData) AddPage(path string) { |
|
|
|
|
|
|
|
|
|
|
|
func Fatal(err error, format string, v ...any) { |
|
|
|
func Fatal(err error, format string, v ...any) { |
|
|
|
err_format := fmt.Sprintf("ERROR: %v; %s", err, format) |
|
|
|
err_format := fmt.Sprintf("ERROR: %v; %s", err, format) |
|
|
|
panic(fmt.Sprintf(err_format, v...)) |
|
|
|
log.Panicf(err_format, v...) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func Fail(err error, format string, v ...any) error { |
|
|
|
func Fail(err error, format string, v ...any) error { |
|
|
|
err_format := fmt.Sprintf("ERROR: %v; %s", err, format) |
|
|
|
err_format := fmt.Sprintf("ERROR: %v; %s", err, format) |
|
|
|
panic(fmt.Sprintf(err_format, v...)) |
|
|
|
log.Panicf(err_format, v...) |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|