diff --git a/render.go b/render.go index a592df7..19eb11f 100644 --- a/render.go +++ b/render.go @@ -232,6 +232,13 @@ func listEntries(fsPath, urlPath, sortKey, order string) []entry { sortEntries(folders, sortName, order) sortEntries(files, sortKey, order) + // Nothing to list (only index.md, which is rendered above): return no + // entries so the Files section is suppressed entirely rather than showing + // an empty listing with just the `..` row. + if len(folders) == 0 && len(files) == 0 { + return nil + } + // `..` row mirrors the header Up button so the listing itself is // navigable without reaching for the header on mobile. Prepended after // sort so it always sits at the top regardless of folder names.