digitalcraftsman / hugo-material-docs

Port of Martin Donath's mkdocs-material theme to Hugo
MIT License
706 stars 186 forks source link

hugo 0.18 broke single pages #52

Open matteo-bruni opened 7 years ago

matteo-bruni commented 7 years ago

hi,

with the new 0.18 release of hugo all "single" pages are detected as list (just try the license page on your demo) so the list.html template is used instead of single.html.

this is probably due to:

The primary new feature in Hugo 0.18 is that every piece of content is now a Page ( #2297 ). This means that every page, including the home page, can have a content file with frontmatter. Not only is this a much simpler model to understand, it is also faster and paved the way for several important new features: Enable proper titles for Nodes #1051 Sitemap.xml should include nodes, as well as pages #1303 Document homepage content workaround #2240 Allow home page to be easily authored in markdown #720 Minimalist website with homepage as content #330 Hugo again continues its trend of each release being faster than the last. It’s quite a challenge to consistently add significant new functionality and simultaneously dramatically improve performance. Running this benchmark with these sites (renders to memory) shows about 60% reduction in time spent and 30% reduction in memory usage compared to Hugo 0.17.

jsparedes commented 7 years ago

Considering that list.html is not used in the exampleSite. A "way" to escape from this problem in hugo 0.18, it is not a solution, is delete or rename the file list.html (from folder _default). Maybe, this could help someone until a suitable solution is proposed.

digitalcraftsman commented 7 years ago

Thanks for the report. Sadly, this bug also broke the whole documentation. I'll try to find the exact issue.

Edit: I renamed the default list template temporarily.

digitalcraftsman commented 7 years ago

The new "everything is a page" appraoch in Hugo v0.18 causes that index.md will not be rendered as index.html because it competes against the section template which always seems to win. See spf13/hugo#2802 for more information. There's also a corresponding forum post.

jsparedes commented 7 years ago

Hi, @digitalcraftsman I found a solution. It is not necessary to rename or remove list.html. The solution is to re-structurate your content folder. Also it is necessary, to change the logic in the footer when IsHome, the value 1 must change to 2. I will fork your repo and I will send a pull request for your evaluation.