I noticed a strange behaviour of hugo when there is an index.md
-file in the content-directory: The other markdown files are not processed and the public
-folder does not contain any html files.
I suppose this is a bug, but I am quite new to hugo, so I am not sure if I only misunderstand something. I created a minimal reproduction site and uploaded it to file-upload.net. To reproduce
- unzip the archive and open a terminal inside the extracted folder
hugo -v && find public
hugo new index.md
rm -rf public && hugo -v && find public
After creating the index.md
-file, the something.md
is completely ignored by hugo.
Terminal output
$ > rm -rf public && hugo -v && find public
INFO 2018/03/29 14:50:50 Using config file: /hugo_bug_repro/config.toml
Building sites … INFO 2018/03/29 14:50:50 syncing static files to /hugo_bug_repro/public/
WARN 2018/03/29 14:50:50 No translation bundle found for default language "en"
WARN 2018/03/29 14:50:50 Translation func for language en not found, use default.
WARN 2018/03/29 14:50:50 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
INFO 2018/03/29 14:50:50 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
| EN
+------------------+----+
Pages | 4
Paginator pages | 0
Non-page files | 0
Static files | 0
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0
Total in 70 ms
public
public/css
public/something
public/something/index.html
public/index.xml
public/sitemap.xml
public/tags
public/tags/index.xml
public/categories
public/categories/index.xml
public/js
$ > hugo new index.md
WARNING: date and/or title missing from archetype file "/hugo_bug_repro/themes/default/archetypes/default.md".
From Hugo 0.24 this must be provided in the archetype file itself, if needed. Example:
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---
/hugo_bug_repro/content/index.md created
$ > rm -rf public && hugo -v && find public
INFO 2018/03/29 14:51:33 Using config file: /hugo_bug_repro/config.toml
Building sites … WARN 2018/03/29 14:51:33 No translation bundle found for default language "en"
WARN 2018/03/29 14:51:33 Translation func for language en not found, use default.
WARN 2018/03/29 14:51:33 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
INFO 2018/03/29 14:51:33 syncing static files to /hugo_bug_repro/public/
INFO 2018/03/29 14:51:34 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
| EN
+------------------+----+
Pages | 5
Paginator pages | 0
Non-page files | 0
Static files | 0
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0
Total in 140 ms
public
public/css
public/index.html
public/index.xml
public/sitemap.xml
public/tags
public/tags/index.xml
public/categories
public/categories/index.xml
public/js
Do I miss something here? Should I report this as a bug on github?
I do understand that the file should be called _index.md
instead of index.md
, but I would expect a warning or something from hugo (at least with -v
). When I first encountered this behaviour 2 days ago I had no idea what was happening (I ported a website from version 0.30 to the latest one)
As far as I can tell, this behaviour occurs from version 0.32 onwards.