janraasch/hugo-bearblog

Blogs go to localhost:1313 on server

Closed this issue · 11 comments

My website: https://blog.t1c.dev/

Upon going to https://blog.t1c.dev/blog/ and clicking on one of the blogs, it literally enters the address http://localhost:1313/rose-pine/ instead of https://blog.t1c.dev/online/ .

Hi @ThatOneCalculator, thank you for reaching out ❤️.

My first guess would be that you have the baseURL set incorrectly.

Did you set baseURL (on your config.toml - see https://gohugo.io/getting-started/configuration/#all-configuration-settings) to https://blog.t1c.dev/ when buildling the site?

Let me know, if that helps 👋🏻,
kind regards,
Jan


If that does not help, could you provide a link to the source repo of your blog, so I could have a quick look?

Hi! Sorry for the late response. Yes, it WAS set in my config.toml, which points to that not being the issue.

$ cat config.toml 

baseURL = "https://blog.t1c.dev/"

# The name of this wonderful theme ;-).
theme = 'hugo-bearblog'

# Basic metadata configuration for your blog.
title = "ThatOneCalculator's Blog ʕ•ᴥ•ʔ"
author = "ThatOneCalculator"
languageCode = "en-US"

# Generate a nice robots.txt for SEO
enableRobotsTXT = true

# Generate "Bearblog"-like URLs !only!, see https://bearblog.dev/.
disableKinds = ["taxonomy"]
ignoreErrors = ["error-disable-taxonomy"]
[permalinks]
  blog = "/:slug/"
  tags = "/blog/:slug"

[params]
  # The "description" of your website. This is used in the meta data of your generated html.
  description = "Hugo + Bear = :heart:"

  # The path to your "favicon". This should be a square (at least 32px x 32px) png-file.
  # Hint: It's good practise to also put a "favicon.ico"-file into your "static"-folder.
  favicon = "images/favicon.png"

  # These "images" are used for the structured data templates. This will show up, when  # services like Twitter or Slack want to generate a preview of a link to your site.
  # See https://gohugo.io/templates/internal#twitter-cards and
  # https://gohugo.io/templates/internal#open-graph.
  images = ["images/share.png"]

  # Another "title" :-). This one is used as the site_name on the Hugo's internal
  # opengraph structured data template.
  # See https://ogp.me/ and https://gohugo.io/templates/internal#open-graph.
  title = "ThatOneCalculator's Bear Blog ʕ•ᴥ•ʔ"

  # This theme will, by default, inject a made-with-line at the bottom of the page.
  # You can turn it off, but we would really appreciate if you don’t :-).
  # hideMadeWithLine = true

It also just seems to be a problem with Blog > Redirect, because going to the URL manually seems to be fine.

Hi @ThatOneCalculator, seems strange 😅.

So the template which is being used to render that list of blog posts is

    <li>
      <span>
        <i>
          <time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
            {{ .Date.Format "02 Jan, 2006" }}
          </time>
        </i>
      </span>
      <a href="{{ .Permalink }}">{{ .Title }}</a>
    </li>

see https://github.com/janraasch/hugo-bearblog/blob/master/layouts/_default/list.html#L19.

Looking at the HTML source

Screenshot 2021-02-09 at 08 21 09

we can decude that the Permalink of a blog post is http://localhost.... for some reason 😇.

Here is some documentation on Page.Permalink: https://gohugo.io/variables/page/ and https://gohugo.io/content-management/urls/.

Maybe that already gives you a clue 😊.

Otherwise, could you share the contents of your content/blog/directory?

image
All that's in content/blog are these md files and the log.txt from my text editor.

I also took a look at the documentation, and despite what I tried, I couldn't get it to work...

$ cat _index.md 
+++
title = "Blog"
+++
$ cat online.md 
+++
title = "My relationships online"
date = "2021-02-09T05:45:30Z"

#
# description is optional
#
# description = "An optional description for SEO. If not provided, an automatically created summary will be used."

tags = []
+++

I’ve always struggled with finding a healthy way to escape my stresses and problems. I often go to my computer to help escape stress, sometimes it works but sometimes it doesn’t. I feel like interacting online with other people -- with both friends and with strangers -- has helped me a lot sometimes, but at other times, it didn’t help, or even made me feel worse. The idea of conversing online is frankly strange, you’re sharing details about your life and opening up to people you may just barely know, or don’t even know at all. But I feel that’s part of the beauty of it all. 


I used to think of myself as the center of everything I did (at least in the online world), because I felt a large disconnect between me and everyone else I was conversing with, because I couldn’t see them. However, this changed a lot because of the pandemic. The more and more I had to connect with my friends online, the more I realized that the people I was connecting with who I didn’t know were people like me, trying to find friendship through online communities. I have honestly made some of my best friendships during the pandemic online, meeting new people and having a place to vent about my problems in life.


There certainly has been some negative responses to what I’ve said in forums or on servers, some of which were completely justified, but a lot of the times, I find myself in great support groups online who are not only willing to help me through my anxieties and stresses, but let me comfort others when they feel down as well.


So, if you're reading this, thank you. You've helped make all the difference. 💟#

@janraasch any other ideas?

Hi @ThatOneCalculator, I am sorry for the late response 😌. Could you gimme access to the full source code of your blog? I think at this point that's probably the easiest so I can try to reproduce and then hopefully pin down the problem.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.