The use of baseof

Hi everyone,
Newbie here!

I am attempting to convert an existing website to Hugo – so I can get away from a CMS. I was thinking that since all the css, js, images and html already exist I didn’t really need to use a Template from Hugo. Also I didn’t need to create a template. And I would just use YouTube to get up to speed.

I have been able to create two pages of my site. I put both of them in “content” and ran “hugo server -D” - it worked. But I realize the I was repeating the header (a navbar) and a footer in both of the files.

So, I re-watched Mike Dane’s video on “baseof”. But it does not work – at least the way I set it up.

So can someone provide a different link on how to create the ‘baseof” file – recall that I am doing this without the use of a template. Or provide some code or structure that will help me get this done.

I’m sure I’m just missing something important but everything I have tried just doesn’t work. I did search the questions and found a couple entries but not much help.

Is it possible I have to create a Template?

BTW – maybe you can setup a newbie (beginner) questions section. It would help guys like me I’m sure.

Johnf

Hi there,

Short answer: you probably do need to create a template.

Long answer:

  1. Generally speaking, you need content files and layout (ie template) files. The content files are, well, the contents (ie text, images, etc) and the layout files tell Hugo how to arrange this information to output a page. Content = eggs, milk, flour; Layout = recipe; Website = pancakes.

  2. It’s generally easier to get help here for specific questions when we can see your code. Have a read about Requesting Help for some more details. We don’t really know what you’ve tried and how you’ve done it, so it’s difficult to say what you should do to fix it.

  3. We have a list of helpful resources here: Recommended Reading Reference

Thanks - I will start reading the recommended reading.
Providing code did not appear to be helpful in my mind since I can make the pages work (therefore it was not the html or css …) by just adding the header and footer to each of the files (pages). So when you say provide the code - I’m not sure what code I would have provided. I do believe that my error messages might have been helpful.

  1. Error building site - plain HTML documents not supported
  2. Error building site - unmarshal failed: invalid character ‘{’ looking for beginning of object key string.

Hopefully, the reading will provide the clues to what I am doing wrong! If I have to add a template - I guess I will.

After reading a few of the articles (hugo-tutorial-static-site-ecommerce) I found a different way to add header+footer files to the layouts/index.html using partials. However, now I have the issue adding a second file and I can’t get that to work. I am just not getting the understanding I need to get this done. BTW the index/home/landing pages is exactly what I want/need. I am able to add styles, images everything. But I can’t even get the navbar to find the next page.
I need a mentor - I am willing to pay for the persons time.
Johnf

Turns out I have success!!! Being a newbie and not wanting to build a blog (and of course all the tutorials are about building blogs) but to build single pages - was a major climb. There is very little information for building static single pages in the doc’s. But I kept looking through so many forum post until I found one that made sense to me. It was just a three line paragraph that was a response to some question. But I got it done. So now the question is where do I post the information on how I got it to work?

Well - you could make a site (in Hugo)!! Or depending on how long it was, post it to this thread, so others searching for the same problem will find not only the questions, but the answers too.