Hi,
Context:
I try to convert my private website from an age old templating software (WML) to hugo. It contains various files, static pages, and php pages. The first step was to put everything I had into static/ (-> success). Next step is now to convert page by page to content/ with my own theme (partial/header.html , partial/footer.html, _default/single.html and index.html are populated with content) which matches what I had there before (1:1 conversation, just changing the backend). So far I managed to convert the index page (2 languages, index.en.html + index.de.html) successfully (this change is live). The output looks like I want to have it. This is not a blog like setup, it is old-style-pages setup. You can check https://www.leidinger.net/ for what I want to do, specially follow the link to “X11” (which is coming from “static/” so far) and what is linked from this page (this is creating me the most headaches so far, see below).
Issue(s):
- I have several pages on the same level, not only /index.html but also /a.html or /b.html. When I try to mimic the same in hugo nothing gets created in the output directory. With a different template I once got a subdirectory with the name of the page, e.g. /a/index.html, but currently I don’t. Both is not expected. While the subdirectory is probably a misunderstanding on how hugo should work, not generating something at all is unexected (see also following point).
- When I create content/X/index.en.html, nothing is generated (yes, “draft: false” for the file in question). The same for content/X/somethingelse.html or content/testhugo.html.
- hugo tells me that there is a duplicate target path (for /index.hml), but it does not tell me which files are mapping to the same output filename.
Main questions:
- How to tell hugo to tell me which files it tries to touch (source + dest) and why it does or does not create an output file? e.g. loading theme/mytheme/partial/header.html, …, not generating output file due to draft=true, …
-
How to convince hugo to tell me which files are mapping to the same target filename?
or in short: How to tell hugo to make his work more observable? (= basic stuff which you need to have when you need to debug something)
What I tried so far:
- enable “–verbose”
- enable “–log”
- enable “–debug”
- enable combinations of the options above
- add to each page: {{ warnf “Processing %q as type %q/%q (draft: %d)” .File.Path .Kind .Type .Draft }} -> results in no log output at all
- add to each file of the template: {{ warnf “Processing %q as type %q/%q (draft: %d)” .File.Path .Kind .Type .Draft }} -> results in printing some output for index.en.html, but not the output as I hoped for (print out each template filename)
I have spend hours on this, including googling around what I may have wrong in my template. I stumbled upon various posts which try to add some debugging on their own, but far from something useful in this situation (a little bit “you get no output at all” vs. “having some output files which do not contain what you want to get”).
Bye,
Alexander.