(dir, file, content string)
| 47 | } |
| 48 | |
| 49 | func writeDocusaurus(dir, file, content string) error { |
| 50 | _ = os.Mkdir(dir, dirMode) |
| 51 | date := "---\n## => Content Auto Generated, " + |
| 52 | strings.ToUpper(time.Now().UTC().Round(time.Second).Format("02 Jan 2006 15:04 UTC")) + "\n---\n\n" |
| 53 | filePath := filepath.Join(dir, file+".md") |
| 54 | log.Printf("Writing: %s, size: %d", filePath, len(content)) |
| 55 | //nolint:wrapcheck |
| 56 | return os.WriteFile(filePath, []byte(date+content), fileMode) |
| 57 | } |
| 58 | |
| 59 | // makeGenerated writes a special index file that the website can import. |
| 60 | // Adds all param sections except global into a docusaurus import format. |
no test coverage detected