Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/winter. a thoughtful static website generator for long-lasting content twos.dev/winter
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334package cmd // import "twos.dev/winter/cmd"
import ( "fmt"
"github.com/spf13/cobra" "twos.dev/winter/cliutils" "twos.dev/winter/document")
func newCheckCmd() *cobra.Command { return &cobra.Command{ Use: "check", Short: "Check the built site for broken local links and resources", Long: cliutils.Sprintf(` Check every HTML and CSS file in the configured dist directory. Local links, images, responsive image candidates, scripts, stylesheets, and fragments must resolve. External URLs are not requested. `), Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { cfg, err := document.NewConfig() if err != nil { return err } if err := document.CheckSite(cfg.Dist); err != nil { return err } fmt.Println("Site check passed.") return nil }, }}