commands/new: Improve theme creation

- Update the skeleton structure to match the new template system.
- Add a --format flag to the `hugo new theme` command to control the
  format of the site configuration and default archetype files.
- Remove theme.toml. This file's presence can be confusing for new
  users, and the README in the themes repository already has an example.
- Remove the LICENSE and README files from the skeleton. These files
  are not needed for a theme to work, and they can be added later by
  the user if desired.

Closes #13489
Closes #13544
This commit is contained in:
Joe Mooring 2025-03-30 12:31:12 -07:00 committed by Bjørn Erik Pedersen
parent e6e18e9122
commit 24ac6a9de9
22 changed files with 123 additions and 136 deletions

View file

@ -20,7 +20,7 @@ exists themes
hugo new theme -h
stdout 'Create a new theme \(skeleton\) called \[name\] in ./themes'
hugo new theme mytheme
hugo new theme mytheme --format yml
stdout 'Creating new theme'
! exists resources
cd themes
@ -34,22 +34,21 @@ checkfile content/posts/post-1.md
checkfile content/posts/post-2.md
checkfile content/posts/post-3/bryce-canyon.jpg
checkfile content/posts/post-3/index.md
checkfile layouts/_default/baseof.html
checkfile layouts/_default/home.html
checkfile layouts/_default/list.html
checkfile layouts/_default/single.html
checkfile layouts/partials/footer.html
checkfile layouts/partials/head.html
checkfile layouts/partials/head/css.html
checkfile layouts/partials/head/js.html
checkfile layouts/partials/header.html
checkfile layouts/partials/menu.html
checkfile layouts/partials/terms.html
checkfile layouts/baseof.html
checkfile layouts/home.html
checkfile layouts/list.html
checkfile layouts/single.html
checkfile layouts/taxonomy.html
checkfile layouts/term.html
checkfile layouts/_partials/footer.html
checkfile layouts/_partials/head.html
checkfile layouts/_partials/head/css.html
checkfile layouts/_partials/head/js.html
checkfile layouts/_partials/header.html
checkfile layouts/_partials/menu.html
checkfile layouts/_partials/terms.html
checkfile static/favicon.ico
checkfile LICENSE
checkfile README.md
checkfile hugo.toml
checkfile theme.toml
checkfile hugo.yml
exists data
exists i18n