How to adapt to the new template system introduced in Hugo 0.146.0?

According to these resources:

I tried making hugo-theme-yue adapt to the new template system.

I renamed some directories and changed {{ template "_internal/foo.html" . }} to {{- partial "foo.html" . }}.

Original directories:

layouts
├── 404.html
├── _default
│   ├── baseof.html
│   ├── home.html
│   ├── list.html
│   ├── _markup
│   ├── rss.xml
│   └── single.html
└── partials
    ├── body
    ├── footer
    ├── footer.html
    ├── head
    ├── header
    ├── header.html
    ├── head.html
    ├── main
    └── single

Current directories:

layouts
├── 404.html
├── baseof.html
├── home.html
├── list.html
├── _markup
│   ├── render-heading.html
│   └── render-table.html
├── _partials
│   ├── body
│   ├── footer
│   ├── footer.html
│   ├── head
│   ├── header
│   ├── header.html
│   ├── head.html
│   ├── main
│   └── single
├── rss.xml
└── single.html

This is the commit that made changes:

Are these changes enough?

Looks very much like what I did for v5 of my Zen theme hugo-theme-zen/layouts at main · frjo/hugo-theme-zen · GitHub

I like the new layout structure, feels better organised.

1 Like

The file single.html is renamed to page.html.
Both work.

Also see New template system in Hugo v0.146.0

3 Likes

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