Commit b7c1e89
Changed files (3)
internal
generator
internal/generator/compare.go
@@ -149,17 +149,21 @@ func generateComparePage(base, head string, params Params) error {
})
for i := range commits {
- commits[i].Href = filepath.ToSlash(filepath.Join("../commit", commits[i].Hash+".html"))
+ commits[i].Href = filepath.ToSlash(filepath.Join("../../commit", commits[i].Hash+".html"))
}
- fileName := baseRef.DirName() + "..." + headRef.DirName() + ".html"
- outPath := filepath.Join(params.OutputDir, "compare", fileName)
+ dirName := baseRef.DirName() + "..." + headRef.DirName()
+ outDir := filepath.Join(params.OutputDir, "compare", dirName)
+ if err := os.MkdirAll(outDir, 0o755); err != nil {
+ return err
+ }
+ outPath := filepath.Join(outDir, "index.html")
f, err := os.Create(outPath)
if err != nil {
return err
}
- rootHref := "../"
+ rootHref := "../../"
err = templates.CompareTemplate.ExecuteTemplate(f, "layout.gohtml", templates.CompareParams{
LayoutParams: templates.LayoutParams{
README.md
@@ -42,7 +42,7 @@ Generated paths follow GitHub repository conventions:
| `/commits/<ref>/page-N.html` | Commit history (page N) |
| `/branches.html` | Branches list |
| `/tags.html` | Tags list |
-| `/compare/<base>...<head>.html` | Diff between refs |
+| `/compare/<base>...<head>/` | Diff between refs |
### Feeds & API