Jump to ratings and reviews
Rate this book

Hugo in Action

Rate this book
Build and deploy a live website in just 30 minutes using Hugo. The Hugo engine lets you rapidly deliver static sites that are low maintenance, high performance, and feature rich.

In Hugo in Action you will

    Building web pages with Hugo and Jamstack
    Creating content using Markdown
    Content management with Hugo
    Designing new Hugo themes
    Using the Go template language
    Managing dependencies with Hugo modules
    Accessing APIs with Jamstack
    Adding a shopping cart using JavaScript
    Content tagging with markup

Sometimes, simple is better. Static websites—sites with fixed content—are easier to create and maintain, and inherently more secure than dynamic pages. Hugo in Action is a hands-on guide to using the Hugo static site engine to render these websites in milliseconds. Working with a complete example website and source code samples, you’ll learn how to build and host a site that will wow users and stay stable without a third-party server. Full coverage of the Jamstack (Javascript, APIs, Markdown) shows how easy it is to add complex features to super-simple sites, including eCommerce shopping carts, dynamic forms, and multilingual options.

About the technology
Because they load pre-built pages, static websites are simple, secure, and incredibly fast. With the Hugo static site generator you can build and render a website in seconds without the grind of hand coding the pages. Hugo takes a directory of content and templates and renders it as a full HTML and CSS website—perfect for blogs, documentation, and other sites that don’t require real-time updates.

About the book
In Hugo in Action you’ll learn step-by-step how to build efficient, low-maintenance static web sites. You’ll use Hugo as a CMS and web development environment, create custom pages, and design your own Hugo themes. And you won’t stop there! Moving beyond the basics, you’ll incorporate the Jamstack model to add capabilities like eCommerce and your own APIs. The rich websites that are flexible and incredibly stable.

What's inside

    Building web pages with Hugo and Jamstack
    Using the Go template language
    Managing dependencies with Hugo modules
    Content tagging with markup

About the reader
For web developers with a basic knowledge of JavaScript.

About the author
Atishay Jain is a Senior Computer Scientist at Adobe. He has developed web-based software used by millions of Adobe Creative Cloud customers.

Table of Contents
PART 1 STATIC HUGO LOADING FAST, BUILDING TO LAST
1 The Jamstack and Hugo
2 Live in 30 You now have a website
3 Using markup for content
4 Content management with Hugo
5 Custom pages and customized content with the Go template language
6 Structuring web pages
7 Creating your own theme
8 Hugo Plugins for everybody
PART 2 EXPANDING WITH THE DYNAMIC OUTSIDE, STATIC INSIDE
9 Accessing APIs to enhance functionality
10 The power of JavaScript
11 Breaking barriers with custom APIs and webhooks
12 Adding e-commerce capabilities using the Jamstack
13 Wra

857 pages, Kindle Edition

Published May 17, 2022

10 people are currently reading
2 people want to read

About the author

Atishay Jain

4 books

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
0 (0%)
4 stars
0 (0%)
3 stars
0 (0%)
2 stars
0 (0%)
1 star
1 (100%)
Displaying 1 of 1 review
Profile Image for Hots Hartley.
383 reviews13 followers
July 28, 2024
Fool’s gold. I read the entire book and am no more capable of building a simple Hugo site I envisioned when I started. The book has a way of explaining and teaching a lot about Jamstack and various snippets and features without actually empowering me to build a site. That start-from-scratch-level creativity, that build-it mentality are missing.

I can understand how everything works perfectly based off the text, and still be perfectly incapable of building a full site according to my design spec and imagination. I find it hard to even tweak another theme from Hugo's official gallery without understanding its quirks and inner workings.

To be fair, this inaccessibility is more a problem of the Hugo template engine and maintainers than this book. The core difficulty of Hugo is how widespread the generative code becomes, with logic sprinkled throughout a project directory in seemingly random places like index.html, _index.html, public folder, layouts, subfolder ptmpl files, imported modules, node packages, downsized copies of images, and that ever-annoying "front matter" toml, yaml, and json.

But after reading this book, I still don't know why they call it "front matter." This book throws around the term like it's common knowledge, but they should actually state the filename instead of using a generic term like front matter. Is it hugo.toml? config.yaml? Header metadata? It's never clear because the basics are never explained.

The book would have been better served building up a full-featured website that is more visually appealing from the start, then deep-diving multiple themes from the hugo gallery, such as toha, gallery, ananke, or any others that have multiple complicated moving parts but would make better sense when built up brick by brick, component by component. Otherwise, the gap between the boring basic themes introduced in this book, and what anybody wants to build to appeal to the general public, is too great. The lessons you learn from building up the basic Acme Theme in this book do not translate to understanding or modifying the best themes you find in Hugo's themes gallery at https://themes.gohugo.io/. The book should deep-dive more of those themes and address how a user would modify, customize, or extend each of those. Then the book should teach us how to build our own equally complex and appealing theme from scratch. Acme and Eclectic may be teachable, but they're so unappealing and so far from what people are building on the cutting edge that they're not even worth the time investment it takes to follow the stages in this book. It's like spending 300 pages discussing how to do the hopscotch when kids just a year older are driving go-karts. You can finish this book and still have no idea why that theme on Hugo’s gallery mysteriously breaks in a SASS inconsistency, or why you keep finding minified HUGO logos and cruft in your public directory after building.

I follow every chapter and exercise step by step, but when it comes to swap in my own images, they don’t match the background color or framing. Then what? How to change a simple color? Language of text? Font? None of this is covered.

Instead, the content focuses too much on features, not on design. Add items on the site to my cart like an online store? Nobody will buy your stuff if you can’t tweak the page’s appearance, design, placement. No discussion of how to make incremental improvements or add custom elements. No explaining how a complicated theme works. Too much on the technical side, with diagrams of folders that don't elucidate where a site comes from, what code is executed, and what logic in which files we should manually modify to change the website's appearance. The confusing part about Hugo is the decentralization of the code, making it hard to debug and track a site's logic or layout, not adding Go or Shopify functionality. The topics covered in this text are mostly useless knowledge like directory hierarchy and edge features, with not nearly enough on design and layout.

Not enough on adding your own custom elements, like favicon, images, color palettes, and where to find top-level landing page code to modify. In fact, the book states that landing page index.html logistics vary highly between themes, making it hard to generalize. Then show us how to do it for multiple themes, instead of waving it away as an exercise for the reader! Landing page logic is the most important part of a website! It's the first step to building anything of value.

There are not enough walkthroughs on themes with tons of dependencies. Many of examples are older versions, resulting in build errors when running hugo server -D, such as scss missing here, sass missing there, random piecemeal library dependencies requiring an npm update and then not syncing well with the theme, so you have to debug the theme.

With other languages and frameworks like HTML or CSS or Swift, Googling gets you documentation, stackoverflow and qiita articles, and GitHub gists. With Hugo, you find a bunch of Hugo forum posts full of snark, with Hugo fanatics talking down users with a condescending tone, such as reminders from bep that he does this on his own volunteer time, or jmooring reminding users to follow etiquette, or nekr0z asking for code and "show us your effort" before offering help (“We can only make wild guesses” ... “We contribute to documentation on our own free time. And what did you contribute to documentation exactly?” ... “See this rulebook for how to post questions”), prematurely closed and inactive threads, and people with the same questions being asked to post their repo or code. If you need to see code to debug a problem, your framework has a problem!

And this book does nothing to help solve that core problem. A recipe book featuring how to extend or tweak various themes would have been more helpful.

No wonder there aren’t many books written on Hugo. It simply changes too quickly, breaking old code too readily, with too little empathy from its maintainers.

Hard pass, avoid Hugo like the plague!
Displaying 1 of 1 review

Can't find what you're looking for?

Get help and learn more about the design.