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).
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:
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.
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.
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?
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.
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?
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