In this post we’ll be adding content to the example.com site we created previously using Hugo.

Hugo’s quick start guide suggests creating content via the command hugo new posts/my-first-post.md, where everything before the forward slash is the command and everything after is the filename (md being the suffix for Markdown, which I’ll go into in a later post). This worked, but unhelpfully created the file at a completely different location to the one I’d been working at:

AWSB0003-01_Hugo_New_Wrong_Path.png

Turns out I need to have the command prompt pointing at the content subfolder in the example.com folder. No problem. Having repointed and re-run, some new subfolders are created:

AWSB0003-02_Hugo_New_Content_Folder.png

where the posts subfolder contains our new file my-first-post.md and the resources subfolder contains, well, not much of anything yet. Opening my-first-post.md presents us with this:

AWSB0003-03_MyFirstPost_VisualStudioCode.png

Some top quality content and a quick save later:

AWSB0003-04_MyFirstPost_Content.png

And we’re ready to go! Or so I thought. While I was editing the Markdown file I’d closed the command prompt, and when I opened a new one from the Start menu and ran hugo server I received an error:

1
2
3
Building sites … WARN 2019/10/14 18:22:41 found no layout file for "HTML" for "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/10/14 18:22:41 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/10/14 18:22:41 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.



I tried opening the command prompt from the example.com folder instead. It’s also worth noting that, by default, Hugo creates all new content as drafts (draft: true), so the command hugo server -D is needed to force all content to show.

Success!

AWSB0003-05_MyFirstPostBuild.png

That’s it for the example site now. In the next post we’ll start building the AmazonWebShark blog.

Thanks for reading ~~^~~