Newbie trying to create tutorials

Hi all,

I’m a newbie to HUGO and static site generation in general. I’m trying to create some tutorials for people like myself so that static site generation is more widely available as an option for bloggers and site creators who don’t want to be financially or systemically dependent on Wordpress, Squarespace, etc.

The HUGO documentation seems geared towards intermediate / advanced web developers who already understand static site development. More of a “this is how you might do it in another system, but this is how you do it in HUGO”. Maybe that is where HUGO wants to stay as an option-- only for those in-the-know already.

If anybody else sees a future for HUGO with wider adoption, and is willing to answer some very newbie questions, I would greatly appreciate it.

My first question: I’m trying to create a simple list of all content pages in a folder.

I have a content folder

content
– image
– projects
– posts
– imageGallery

I have a layout in

layouts
– imageGallery
– projects
– posts

in layouts/imageGallery I have a file

list.html

that has this content:

<html>
    <body>
        {{ .Content }}
        
        {{ range where .Data.Pages "Section" "image"}}
            <p>{{ .Title }}</p>
        {{ end }}    

    </body>
</html>

I just want it to display the titles of all the files in the content/image folder. It does nothing.

What am I doing wrong here?

Try to use .Site.Pages instead of .Data.Pages for ranging the files. .Site.Pages contains all files that are stored under content.

.Data.Pages only lists files that are stored in the data folder.

My advice, having tried something similar in the past, is wait until you are much more familiar with Hugo.

I used to know and be part of a particular e-commerce extension for Joomla. I have come across so many tutorials that actually suggest a way to do things which is not the best, and is clear thhe writer of the tutorial is not an expert.

You make a fair point about Hugo docs though. I personally think the solution is for experienced / expert users to write tutorials in a way that works for new users. Not all people can do this, but some can. When you find such tutorials, they have a lot of value.

We should do more to cater to the beginning web developers/content
creators. We would love help with this. Even just questions beginners have
would be a huge help.

digitalcraftsman- thanks for that suggestions, I’ll try it when I get home
from work.

@mikeaja- that’s a wise suggestion. My hope is to bridge the gap via the
process, so that I’ll be writing the tutorials as I learn. I frankly find
it difficult to muster the enthusiasm for writing a tutorial once I’ve
mastered something. I don’t plan to publish them as I go, though, so that
I’ll be able to edit them with my end knowledge as well as show them to
experts before they are published.

@spf13- I come to static site generation as an educator primarily. Many
students like being able to do a project while simultaneously looking under
the hood. Hand-coded HTML/CSS(/LESS/SASS) is a good place to start, and
Wordpress-style CMSes are very useful for facilitating low-tech creative
projects, but to get under the hood of a CMS is too great a technological
leap for many students. Static site generation bridges the gap, and is lots
of fun. I would certainly appreciate any help making these tutorials! Out
of the 5 or so SSG I tried, I like HUGO the best.

@curiouskoala It’s great that you want to share your experiences while learning Hugo. Especially as an educator you could have the ability to describe some complicated aspects more easily to new users.