Do not render parent of root directory
This commit is contained in:
@@ -269,17 +269,22 @@ func generateS3HTML(entries []indexgen.FileEntry, opts *indexgen.Options, client
|
||||
return fmt.Errorf("failed to get HTML template")
|
||||
}
|
||||
|
||||
// Determine if we're at root level (no parent directory)
|
||||
isRoot := (indexKey == opts.OutputFile) // root level index.html
|
||||
|
||||
// Prepare template data (similar to ProcessDir in indexgen)
|
||||
data := struct {
|
||||
DirName string
|
||||
Entries []indexgen.FileEntry
|
||||
DirAppend bool
|
||||
OutputFile string
|
||||
IsRoot bool
|
||||
}{
|
||||
DirName: opts.TopDir, // Use bucket name as directory name
|
||||
Entries: entries,
|
||||
DirAppend: opts.DirAppend,
|
||||
OutputFile: opts.OutputFile,
|
||||
IsRoot: isRoot,
|
||||
}
|
||||
|
||||
// Generate HTML content in memory
|
||||
|
||||
Reference in New Issue
Block a user