concept resource in category hugo

appears as: resources, resource, The resources, resources
Hugo in Action: Static sites and dynamic JAMstack apps

This is an excerpt from Manning's book Hugo in Action: Static sites and dynamic JAMstack apps.

A website built with a JavaScript based framework and a backend mostly hosted as Cloud Functions with no markup for content meets the Jamstack definition. Writing data as Markup provides a lot of advantages over the approach of storing it in a database and fetching it using an API especially if the data is unstructured. We can use a version control system like Git to version the data changes. Having the data along with the code eases migration across services and build environments. We can store all configuration together. Optimization and testing gets easier with the ability to boot build environments on demand. With unstructured content most of the organization and querying capabilities of the databases are not useful. Hosting blogs or generic web pages based on a database is not the best use of resources. It is possible mostly because of the effort that has been put into optimizing databases and programming languages used to build these CMS for other use cases.

  • resources When processing data, Hugo caches the results of heavy operations in the resources folder. We should put this folder into our version control and reuse its data across builds. This folder is one of the key ingredients of getting great performance with Hugo. Processing images is a CPU intensive operation and takes time. Most images don’t change across builds and caching the processed images for as long as they do not change provides Hugo with a major performance boost.