@@ -45,7 +45,7 @@ defmodule ExDoc.Formatter.HTML do
45
45
generate_list ( nodes_map . tasks , config ) ++
46
46
generate_redirects ( config , ".html" )
47
47
48
- generate_build ( Enum . sort ( all_files ) , build )
48
+ generate_build ( all_files , build )
49
49
config . output |> Path . join ( "index.html" ) |> Path . relative_to_cwd ( )
50
50
end
51
51
@@ -157,7 +157,12 @@ defmodule ExDoc.Formatter.HTML do
157
157
end
158
158
159
159
defp generate_build ( files , build ) do
160
- entries = Enum . map ( files , & [ & 1 , "\n " ] )
160
+ entries =
161
+ files
162
+ |> Enum . uniq ( )
163
+ |> Enum . sort ( )
164
+ |> Enum . map ( & [ & 1 , "\n " ] )
165
+
161
166
File . write! ( build , entries )
162
167
end
163
168
@@ -281,7 +286,15 @@ defmodule ExDoc.Formatter.HTML do
281
286
is_binary ( dir_or_files ) and File . dir? ( dir_or_files ) ->
282
287
dir_or_files
283
288
|> File . cp_r! ( target_dir , dereference_symlinks: true )
284
- |> Enum . map ( & Path . relative_to ( & 1 , output ) )
289
+ |> Enum . reduce ( [ ] , fn path , acc ->
290
+ # Omit directories in .build file
291
+ if File . dir? ( path ) do
292
+ acc
293
+ else
294
+ [ Path . relative_to ( path , output ) | acc ]
295
+ end
296
+ end )
297
+ |> Enum . reverse ( )
285
298
286
299
is_binary ( dir_or_files ) ->
287
300
[ ]
0 commit comments