Hugo: Automatically get a theme

Created on 20 Nov 2017  路  5Comments  路  Source: gohugoio/hugo

We have 185 themes in the themes repo now (!) and git clone --recursive, while being a convenient way of "testing different themes", is a big task, even timing out for many people.

This issue may be the start to a more complete hugo get command that I have been talking about, which could get some ways of handling external resources such as themes and other components (shortcodes etc.).

But the scope of this is smaller, it is about themes only.

The simple goal is to make this even quicker:

https://gohugo.io/getting-started/quick-start/

Step 3 should be reduced from:

cd quickstart;\
git init;\
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke;\

# Edit your config.toml configuration file
# and add the Ananke theme.
echo 'theme = "ananke"' >> config.toml

To:

# Edit your config.toml configuration file
# and add the Ananke theme.
echo 'theme = "ananke"' >> config.toml

If you want to test another theme, just edit your config.toml.

There are lots unsaid in the above, but that is just information hiding so I don't see all the problems that may convince me not to do this.

Some notes to the above:

hugo get https://github.com/budparr/gohugo-theme-ananke.git
hugo get -u https://github.com/budparr/gohugo-theme-ananke.git
hugo get -u ./...
hugo get gohugo-theme-ananke
hugo get --prune

/cc @digitalcraftsman

Enhancement Stale

Most helpful comment

Isn't this a duplicate of #2648?

No, it is a sub-set of that issue. Much smaller in scope.

All 5 comments

185 themes is an impressive number and it can be cumbersome to clone all of them. I'll think a bit more about the hugo get command in the next days.

@bep the code examples for the reduction of step 3 are the same ;)

@bep the code examples for the reduction of step 3 are the same ;)

Fixed ... Also note in the above that the current theme repo will be left unchanged, this is just some "lazy Git client" on top of that.

Isn't this a duplicate of #2648?

No, it is a sub-set of that issue. Much smaller in scope.

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

digitalcraftsman picture digitalcraftsman  路  3Comments

antifuchs picture antifuchs  路  3Comments

arikroc picture arikroc  路  3Comments

kaushalmodi picture kaushalmodi  路  3Comments

MunifTanjim picture MunifTanjim  路  3Comments