concept Hugo Pipes in category hugo

appears as: Hugo Pipes
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.

On line 5, we use the resources API to find the file products.csv in the page bundle for the current page. The resources APIs are a very powerful way to not only access resources but also to process, manage and transform them. We will delve more into resources APIs with Hugo Pipes in chapter 6. We take the $products and then parse them using comma (,) as the delimiter for CSV parsing. The resultant slice is stored in in $parsedProducts.

With the Go Template Language in Hugo we can build templates for markup controlled HTML pages in as much detail as needed. In this chapter we enable having multiple types of pages sharing template code and snippets between them. We will also be looking at how Hugo can help with the JavaScript, Images and CSS with Hugo Pipes. We will be building our foundation to move off the Eclectic theme and have more control over the entire website rendering using our own template code.