I just published a new theme component providing a shortcode to display nice notices, e.g.
Maybe this can be useful for someone.
@budparr : please can you add it to your awesome-hugo list ?
19 Likes
FYI: I updated this component for use with Hugo 0.55.0 or later.
1 Like
This was updated, and can now use Font Awesome version 4 and 5.
This is such a great, handy, and aesthetically pleasing theme plugin. Question for you now that I’m trying to build a site with Hugo after a long (and unwelcomed) hiatus for JAMStack, please:
Are git submodules still the best way to install themes or are there alternatives?
1 Like
I’m afraid I’m not an expert in Git enough to say if git submodule
is the best way. What I can say is that it works well for me.
However I’ve heard that some prefer to use git subtree
.
1 Like
Currently it is the best way, but there is work being done that may change this approach in the future. See:
opened 02:36PM - 29 Apr 19 UTC
closed 07:36AM - 24 Jul 19 UTC
Enhancement
Outdated
This has been mentioned before (I will track down and close that issue), but I'l… l start fresh.
So, Hugo **Themes** and **Theme Components** are very powerful constructs, but the current manual installation/dependency management leaves a lot to be desired. I have tinkered with the idea of using some of the ideas from Go to create a `hugo get` type of command that could do this stuff, but I imagined lots of work, reinventing the wheel, so to speak.
Today I did some quick tests with [Go Modules](https://github.com/golang/go/wiki/Modules), and it works surprisingly well with non-Go type of modules. We would need to add some small layer of logic in Hugo to support it, but we would then get really, really good dependency management in Hugo.
To add a new dependency to a theme or a project would then look like this:
1. `go get -u github.com/bep/my-shortcodes`
2. Add `github.com/bep/my-shortcodes` to the `theme` slice in `config.toml` (and yes, @kaushalmodi, we should add an alias for that config key). Note that we of course still will support the `/themes/my-shortcodes` variant.
When you want to update your dependencies, you do `go get -u` to get the latest minor or patch release etc.
Note that there can only be one version of `my-shortcodes` in a Hugo project at a given time, which is how [Minimal Version Selection](https://github.com/golang/go/wiki/Modules#faqs--minimal-version-selection) comes into play. We need to investigate `github.com/bep/my-shortcodes/v2` vs namespace vs names etc., but that can probably wait.
Note that the above will require that you have Go (>= v1.11) installed, but we should also probably add a `hugo mod vendor` command that writes all the dependencies to a folder in the project which could be used without needing Go.
Shout if you think this is a terrible idea, @kaushalmodi @onedrawingperday @digitalcraftsman @budparr @regisphilibert @RickCogley, and gang.
1 Like
This component hugo-notice
has now localisations in Italian and Portuguese, thanks to contributions of community members
1 Like
Component hugo-notice
just received Arabic and Turkish localisations
It is now avalaible in 9 languages: English, French, German, Italian, Portuguese, Chinese, Russian, Turkish and Arabic
All the best for 2021!
2 Likes