Skip to content

Commit

Permalink
docs: minify blogs
Browse files Browse the repository at this point in the history
  • Loading branch information
gernest committed Feb 13, 2024
1 parent e48790d commit 8f2b7ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/docs/blog.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bytes"
_ "embed"
"fmt"
"html/template"
"log"
"os"
Expand Down Expand Up @@ -57,7 +58,11 @@ func writeBlogFile(path string, ctx Blog) error {
if err != nil {
return err
}
return os.WriteFile(filepath.Join(path, "index.html"), b.Bytes(), 0600)
o, err := minifier.Bytes("text/html", b.Bytes())
if err != nil {
return fmt.Errorf("failed minifying documentation %v", err)
}
return os.WriteFile(filepath.Join(path, "index.html"), o, 0600)
}

func (s *Section) Write(base string) error {
Expand Down

0 comments on commit 8f2b7ef

Please sign in to comment.