func ProcessExt(page *gostatic.Page, args []string) error { if len(args) < 1 { return errors.New( "'ext' rule requires an extension prefixed with dot") } newExt := args[0] ext := filepath.Ext(page.Path) if ext == "" { page.Path = page.Path + newExt } else { page.Path = page.Path[0:len(page.Path)-len(ext)] + newExt } return nil }
func ProcessDirectorify(page *gostatic.Page, args []string) error { if filepath.Base(page.Path) != "index.html" { page.Path = strings.Replace(page.Path, ".html", "/index.html", 1) } return nil }