HUGO

Migration to new laptop not working

Hi, a few weeks (months?) ago I asked about how to migrate my hugo blog since I got a new laptop and wanted to work from there instead of the old one.

In my old laptop everything works fine as usual. But when I asked here (First time using Hugo and need to change my laptop) the answer I got was that I simply had to run brew install hugo and after that git clone my repo on my new laptop. So I did it… And when I tried to run hugo server, it didn’t work. I couldn’t see my website. But I noticed that my themes folder was actually empty, and I remembered that when I first installed it, I had to use a git submodule for the theme (hugo-casper-two). Well, I went back to my old laptop, zipped the folder for the theme and brought it back to the new laptop. Ran hugo server again and, now the server loaded, but without my posts. I am new to Hugo and have no idea why is that.

My site is live with all the posts, and if I run hugo server on the old laptop, I see the site with all the posts and all good… on the new one, if I run hugo server, I do not see my posts. Any tip? Did I miss any steps?

Also, I believe this is worth mentioning…
When running hugo server on the new laptop, I noticed a warning message:

Building sites … WARN 2020/02/14 19:33:41 Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url

WARN 2020/02/14 19:33:41 Page.Hugo is deprecated and will be removed in a future release. Use the global hugo function.

I do not receive that message on the old laptop… maybe because the versio for hugo there is very old?
Old laptop is running Hugo 0.54.0
New laptop is running Hugo 0.64.1

Any tip?

I just noticed something… My posts are actually there… The problem is that the page is loading by default with a single post, which is not mine, but it’s simply called “posts”, but when I click on it, I see the expected page that should be my home page, with all my posts listed. Weird… I start to believe that this is really related to the warning

Building sites … WARN 2020/02/14 19:33:41 Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url

WARN 2020/02/14 19:33:41 Page.Hugo is deprecated and will be removed in a future release. Use the global hugo function.

Updating… I was able to fix one of the warnings:

WARN 2020/02/14 19:33:41 Page.Hugo is deprecated and will be removed in a future release. Use the global hugo function.

Fixed by changing {{ .Hugo.Generator }} to {{ .hugo.Generator }} in my /theme/hugo-casper-two/layouts/partials/head.html.

Now, I just need to find how to fix

Building sites … WARN 2020/02/14 19:33:41 Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url

Ok… I found and changed a few .URL with .Permalink… fixed the warning. But now my site continues to load on a page with a single post that when I click on it, it takes me to what should be my real home page, with a list of my latests posts. :confused:

Two things:

  1. Try a different theme? Maybe that one isn’t updated often enough to be useful to you right now.
  2. There isn’t much we can do without you sharing your repo. That’s why we suggest it first and foremost. Not many folks can imagine what a site’s issue is from a text description. Share your code. :slight_smile:

@Marcelo_Cavalcante_R

Hello. When posting console logs and other code blocks please use proper code fences instead of making them bold.

Either use the provided button in the post GUI i.e. </> or with your keyboard wrap the code with backticks (see your edited posts above).

Thank you.

As you’ve discovered, the original hugo-casper-two theme is no longer being actively developed. It doesn’t work with the latest versions of Hugo (search these forums for other threads on that topic).

If you want to stick with the theme, I recommend finding a fork which has been fixed and following it.

e.g.

(Or make a fork yourself and apply your own modifications.)

1 Like

My bad folks, sorry about that, @onedrawingperday and @maiki.

Here is my code: https://github.com/kalib/blog/tree/from_new_laptop

This is the branch from my laptop. ( I didn’t want to push it to master in order to now break the version that is live. If you open both, the version that is live which I deployed from my old laptop with the old version of hugo (https://www.marcelocavalcante.net) and open the new one from this branch using hugo server, you would see what I mean.
The online version lists all my posts on the home page, the new one lists one one post called “posts”. And clicking on it, I can really see all my posts on the proper page.

I was avoiding having to go to another theme to avoid redoing my small changes, like images, etc… But if this one doesn’t work, yes… that would be my next step, probably trying the fork suggested by funkydan2. thanks for that.

Using the new fork also showed the same issues… I don’t think this is just the theme. By doing some reading it looks like I need to have an index.md file, is that accurate? I don’t remember needing to have that file in the past.

How do I change my “home page” to be the page where my posts are listed?

Well, although I appreciate you guys trying to help me, I will mark this question as solved. I am not a web developer, so my skills are limited and this was very complicated for me to fix/understand. And since I also wasn’t able to get it working properly by following your suggestion of using the fork version of the theme, since I got the same issue, I decided to follow the steps that I would be sure to work.

I decided to uninstall hugo on this new macbook and installed an old version, the same I used in my old macbook, since that one was working fine with my theme. By doing that, my problem is now “solved”. The site is working exactly the same as usual, without any surprises. I know using an old version of hugo is not the best path, but due to my lack of time/knowledge on this, and since I like this theme and do not want to invest a lot of time customizing another theme again at this point, I’ll just continue using this old version of Hugo (0.54).

Thanks anyway. ;]