WARNING: both index.* and _index.* files, pick one

I am getting the following warning:

$ hugo server
Start building sites …
WARN 2021/04/07 11:51:50 Content directory "/Users/dan/dev/mcneel/rhino3d.com/content/en/reseller" have both index.* and _index.* files, pick one.

My reseller section contains an _index.md branch page:

$ ls -al content/en/reseller/
total 32
drwxr-xr-x  11 dan  staff    352 Jan 20 12:58 .
drwxr-xr-x  34 dan  staff   1088 Mar  3 08:32 ..
-rw-r--r--   1 dan  staff   2708 Jan  8 15:26 _index.md
drwxr-xr-x   3 dan  staff     96 Jan  8 15:24 as
drwxr-xr-x   3 dan  staff     96 Jan  8 15:24 emea
drwxr-xr-x  20 dan  staff    640 Jan  7 16:25 graphics
drwxr-xr-x   3 dan  staff     96 Jan  8 15:24 la
drwxr-xr-x   3 dan  staff     96 Jan  8 15:24 na
drwxr-xr-x   3 dan  staff     96 Jan  8 15:24 pa
drwxr-xr-x  37 dan  staff   1184 Jan 20 12:58 support

Each of the subsections contains a leaf bundle with an index.md. For example:

$ ls -al content/en/reseller/as
total 8
drwxr-xr-x   3 dan  staff    96 Jan  8 15:24 .
drwxr-xr-x  11 dan  staff   352 Jan 20 12:58 ..
-rw-r--r--   1 dan  staff  2613 Jan  8 15:25 index.md

I have verified that none of the child leaf bundles have an branch file…

$ pwd
/Users/dan/dev/mcneel/rhino3d.com/content/en/reseller
$ find . -name _index.md -type f
./_index.md
$ find . -name index.md -type f
./na/index.md
./emea/index.md
./pa/index.md
./as/index.md
./graphics/index.md
./la/index.md

I’m using this exact same pattern in numerous sections of my site but, for some reason, only this particular reseller section is producing this warning.

I’m confused.

I’m running v0.81.0:

$ hugo version
hugo v0.81.0+extended darwin/amd64 BuildDate=unknown

Any chance I could clone the repo?

Sorry, unfortunately not. I’d be happy to send the subsection if that helps.

Bisect your content to narrow it down. Remove half of the directories, test, rinse, repeat.

Ah yes, I forgot to mention that I had already tried a bisect without luck. Good idea though…unless you are referring to all the files in the entire site. I haven’t gone that far yet.

But this is mildly interesting/maddening…if I delete all the content in that section, leaving only the reseller/_index.md file, I still get the same warning. (NOTE: I’m running a git clean -dxf between tests to make sure that all build artifacts are flushed).

Just for grins, run hugo --path-warnings.

1 Like

Ah ha! That pointed toward the culprit…

WARN 2021/04/07 12:52:32 Duplicate target paths: /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/projects/modeling-pen/pen_kyle_thumbnail_hu398a738ddb5cf5fcbf06a396c7b24dec_5742_800x450_fill_q75_box_center.jpg (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/projects/modeling-toaster/toaster_kyle_thumbnail_hu35b344fec3521ee61efea4dfafa7e0f5_312441_800x450_fill_q75_box_center.jpg (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/rhino-7-getting-started/chair_huc28032dd2d97a00bd6b5cb7cb5a7d34f_67958_800x450_fill_q75_box_center.jpg (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/rhino-7-getting-started2/table-chairs_hu43a397dd4d4213963f7c1a3779c9af93_32179_800x450_fill_q75_box_center.jpg (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/rhino-continuity-surfaces/blendsrf-25_hu2d508c1a1bbc4d58766aa36988393d93_39106_800x450_fill_box_center_2.png (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/rhino-deformation/flow_ring-20_hu18e3e52424a210606c5efa9ff0dead4e_22960_800x450_fill_box_center_2.png (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/rhino-edit-curves-surfaces/split_surfaces-003_hua95d100e7eb8427cb9b4284f595bac10_14242_800x450_fill_box_center_2.png (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/rhino-modeling-history/softbox_hu73763fbcca417bfeaa85813af3a03891_15337_800x450_fill_box_center_2.png (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/rhino-nurbs-topology/trimmednurbs-06_hu90518cfc1b027beb4beee5e2a418e1f1_31646_800x450_fill_box_center_2.png (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/rhino-scoop/scoop-46_hucc9e6d7baefda99992ae1ae2df1534b0_18012_800x450_fill_box_center_2.png (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/rhino-text-dimensions/dim-001_300x225_hu60a72ef26fac053cfc80663f715f4104_10745_800x450_fill_box_center_2.png (2), /Users/dan/dev/mcneel/rhino3d.com/public/en/docs/guides/modeling/rhino-windows-interface-introduction/rhinologothumbnail_hu1a10b93b09939b1f0bcfd900bf980944_18190_800x450_fill_q75_box_center.jpg (2), /Users/dan/dev/mcneel/rhino3d.com/public/ru/reseller/index.html (2)
Total in 9350 ms

(yep, no line breaks.) But the last one was:

/Users/dan/dev/mcneel/rhino3d.com/public/ru/reseller/index.html (2)

When I deleted that file, the warning went away.

I wonder why that localized content would cause this warning.

Thanks for the help @jmooring!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.