Some issues with hugo blog deployment

Hi all:
I have been trying to deploy a basic hugo blog, and keep running into issues (I’m a newbie, mostly following online directions).

I have created a local hugo install, made a simple first post, and can see it on a local server.
I then pushed the info to github, created a clouflare “page project”, and linked the github.

The build works with no issue on pages, but the content does not render properly (at all):

https://texas-flute-guild-blog.pages.dev/
Here is the log (everything looks ok):

|2023-10-31T16:22:07.226774Z|Cloning repository...|
|---|---|
|2023-10-31T16:22:08.694831Z|From https://github.com/texasfluteguild/Texas-Flute-Guild-Blog|
|2023-10-31T16:22:08.695542Z| * branch            0c5cc8fd3af81a1bd148833eb32e392442876599 -> FETCH_HEAD|
|2023-10-31T16:22:08.695739Z||
|2023-10-31T16:22:08.810285Z|HEAD is now at 0c5cc8f changed config|
|2023-10-31T16:22:08.811036Z||
|2023-10-31T16:22:08.925612Z||
|2023-10-31T16:22:08.958586Z|Success: Finished cloning repository files|
|2023-10-31T16:22:10.017491Z|No build command specified. Skipping build step.|
|2023-10-31T16:22:10.018731Z|Note: No functions dir at /functions found. Skipping.|
|2023-10-31T16:22:10.019009Z|Validating asset output directory|
|2023-10-31T16:22:10.797114Z|Deploying your site to Cloudflare's global network...|
|2023-10-31T16:22:13.590215Z|Uploading... (66/66)|
|2023-10-31T16:22:13.591042Z|✨ Success! Uploaded 0 files (66 already uploaded) (0.47 sec)|
|2023-10-31T16:22:13.591276Z||
|2023-10-31T16:22:13.891556Z|✨ Upload complete!|
|2023-10-31T16:22:16.123394Z|Success: Assets published!|
|2023-10-31T16:22:17.072643Z|Success: Your site was deployed!|

(I have tried it with and without the “hugo” command on build"… get to the same place:

Here is the github:
https://github.com/texasfluteguild/Texas-Flute-Guild-Blog
I am using the “newsroom” theme (if that matters).

my Hugo version installed on my local machine is 0.98.0

I have read multiple hugo install pages and “how to host a hugo blog on cloudflaire…”

As this is my first time doing this, and I’ll a little out of my element, I think I’m missing something obvious (like something obvious isn’t being uploaded to my github).

Any assistance would be very much appreciated…

Please take a look into your browsers console:

This is not a Cloudflare Pages error but rather a Hugo configuration issue. There are three main problems:

Problem 1 (Custom Domain):

  1. It appears that you intend to host your blog under blog.texasfluteguild.com, but you have not configured this domain in Cloudflare Pages.
  2. Please refer to this guide: Custom domains · Cloudflare Pages docs
  3. Configure blog.texasfluteguild.com as your custom domain to serve texas-flute-guild-blog.pages.dev.

Problem 2 (mixed-content):

For mixed-content issues, there are several potential solutions:

  1. Use relative URLs with a schema like this: //texas-flute-guild-blog.pages.dev/images/thumbnail.svg, which will adapt to the current session’s schema.
  2. Utilize relative paths like this: /images/thumbnail.svg, which will automatically use the schema & authority of the current session.

Problem 3 (Hugo Configuration):

If you prefer not to use relative paths and explicitly want to use the domain blog.texasfluteguild.com in your links, you should define this fully qualified domain name as a variable and incorporate it into every URL you generate.

Personally, I would recommend using relative paths, as they tend to be the most compatible solution.

First, thank you for your reply!

I did originally jump in and create a CNAME on cloudflare to point to blog.texasfluteguild.com (I own Texasfluteguild.com). It was “live”, but the blog looked the same. I want to publish it only to the blog.texasfluteguild.com, and it is… well… a blog, so I don’t think I need tons of “staging areas”.

I’ll redo that and look at see if the console if different…

Would you mind defining “mixed-content”… for me? Is that, internally, some parts of hugo are creating links for https://texas-flute-guild-blog.pages.dev/ and others for blog.texasfluteguild.com…?

If I want to only push to blog.texasfluteguild.com… is my “fix” in the config files I am writting locally (the config.toml file)… looking for all of the places where I can put blog.texasfluteguild.com…?

Wait… just so I am clear… when I put this out at first, I made a CNAME that pointed
blog.texasfluteguild.com to https://texas-flute-guild-blog.pages.dev/… I’m doing that part right… right?

I just checked, and this subdomain does not exist:

https://dnschecker.org/#A/blog.texasfluteguild.com
https://dnschecker.org/#AAAA/blog.texasfluteguild.com
https://dnschecker.org/#CNAME/blog.texasfluteguild.com

Please remove the domain (CNAME) blog.texasfluteguild.com from your DNS section and follow the instructions in this tutorial to set up a custom domain in Cloudflare Pages: Custom domains · Cloudflare Pages docs

Regarding the mixed-content issue, it occurs when a session/connection is established securely, but then a sub-resource is requested using an insecure connection. This means your page is served over HTTPS, but certain requests (as shown in the screenshot) are made over HTTP, which leads to those resources being blocked. This will result in your page not loading properly, as is the case right now.

It’s worth noting that you’re less likely to encounter this issue locally because local traffic typically originates with an HTTP connection and continues with HTTP. Therefore, you might not experience mixed-content errors when testing your site locally.

1 Like

Thanks: looking over these, I realized a big mistake I was making.

yeah… I think I might have one issue figured out: the domain I am using is a .net address, but I made the hugo config as a .com (I own both and just forgot).

The custom domain now works better ( it stops trying to get me to transfer my domain!)…

I will redo my config files and see if that allows hugo to “play nice”…

And, thank you for taking the time to define some things for me. Always learning, right?

2 Likes

I hope so :slight_smile:

Also noticed, you have some malformed URLs/Links in your HTML:

(the three last on the screenshot)

  1. https://blog.texasfluteguild.comsite.webmanifest/
  2. https://blog.texasfluteguild.comfavicon-32x32.png/
  3. https://blog.texasfluteguild.comfavicon-16x16.png/

They should probably be like this:

  1. https://blog.texasfluteguild.com/site.webmanifest
  2. https://blog.texasfluteguild.com/favicon-32x32.png
  3. https://blog.texasfluteguild.com/favicon-16x16.png
2 Likes

Well… I got back to where I was last night. config file has changed and things are pointing to where they are supposed to be… but still stuff with the same broken wbesite.

All of the weblinks you are quoting are things “spat out” so to speak, by hugo… I tried to make a “test” post just to get something going (get it working then tinker). It could be in markdown file I am using to create the post. Will play with that and see if I get something better.

However, it does seem like hugo isn’t generating static HTML files that cloudflare pages likes…

Will do some more poking and try different text files

But your still rendering the .com in the URLs, which you need to change to .net:

I would simply download the source code to any linux server and use grep to find the files which are still containing blog.texasfluteguild.com:

grep -ril "blog.texasfluteguild.com"

Congratulations! Seems to be working now :wink:

The other errors/bugs should not be hard to fix.

Keep in mind that all these errors are all not related to Cloudflare at all. But would have occoured on every service you would have hosted it on.

1 Like

Haha… I think I did too many things at once, so I don’t know what was up there that “fixed” it… I think I had some html that was pushed…

But… thanks to the computing gods!

Thanks!
Jason

yes. It was me and hugo… getting to know each other.
Thank you again for your help!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.