AlpineJS with Hugo

I have been playing around with an impressive JS framework tonight:

A common thing is to need a framework to do DOM manipulation, but the feeling of using React/Vue etc. is like hitting nails with a hammer. Typically the role of jQuery some years ago.

I think it will be even more powerful once this is solved:

10 Likes

Also recommended: https://pca.st/episode/e18dfec0-e80d-4a17-95cb-976cd1a6dfe1

3 Likes

Thinking this might be a big deal for making themes or templates in Hugo !

1 Like

I totally agree: It is Hugo Modules friendly, meaning you can do very powerful stuff without adding additional dependencies or even doing any “npm install”.

1 Like

What I love about Hugo is that it is a single binary—no dependency hell. The functionalities on board are incredible.

Yet, some connection to JS/Node/NPM seems crucial for some projects. So this proposal would be great and a big step towards Hugo’s future.

This is a quote from a Smashing Magazine article

When Matt reflects on whether or not he would have still used Hugo, he says that he loves Hugo, but what he found difficult for this project in particular was that it didn’t have enough of a plugin system — creating banner ads and things of that nature were not programmable enough with Hugo and he needed to inject scripts to accomplish it. These scripts tended to slow the build process down. That said, we still use Hugo for our own site at netlify.com and love it — this caveat is extremely particular to the needs of Smashing’s site in particular.

This looks very promising and something that I would love to test, although I am new to Hugo and Go. Anyway, I cloned the repository and tried to run it (hugo server) but I am getting an error and now I am kinda lost.

The error I am getting is the following (while I have Go installed in my machine):

Error: we found a go.mod file in your project, but you need to install Go to use it. See https://golang.org/dl/.: module "github.com/FortAwesome/Font-Awesome" not found; either add it as a Hu
go Module or store it in "/home/mark/Work/podchops/hugo-alpine-test/themes".: module does not exist

Any help would be greatly appreciated

What is the Go version you have installed?

go version go1.14 linux/amd64
and
Hugo Static Site Generator v0.68.3/extended linux/amd64 BuildDate: 2020-03-24T16:18:11Z