I am working on a template from scratch, It relies on partials.
I have stumbled across an error and want to see the built index.html in its entierety to make sure that hugo is putting things in the right place.
However, the formatting is all over the place within index.html, making it a pain to read.
Is there anything that hugo doesn’t like when building sites? Or anyone have any ideas of quickly formmating code afterwards.
I am viewing code in chrome and firefox and its the same.
The template code to include partials get replaced with the partial’s content. Sometimes we indent template code to make it more readable but this could add the unexpected spaces/tabs.
If this doesn’t help it would help to post a small excerpt of your code that procudes unwanted indentations.
Having looked at it now, it seems that when the template partials are imported they do not adhere to the formatting provided in the index.html in the themes directory, but take upon their own indivdual formmating as if they were a new file.
The Foo link is indented as expected because there was already a tab in front off the partial call. But the template engine doesn not prepend this tab in front of the other lines (the Bar/Buzz link).
I’m not aware of a way that automatically formats the code as you like. The only options I see is to indent the lines for the Bar/Buzz link in the nav.html partial. But this would “uglify” the format of your source code.
As you already mentioned your best option is to use a tool like Gulp to post-process the generated HTML.