Jekyll always 0.0.0.0:4000

Hi

I have a very strange problem with jekyll and jekyll-feed that I have it running in docker with this image of docker bretfisher/jekyll-serve:latest

In the _config.yml I have the following:

baseurl: ""
url: https://mydomain.github.io
feed:
   url: "https://mydomain.github.io"

And when I run:

docker exec jekyll bundle exec jekyll serve build to update the feed and the website and then upload it to github, I see that everything that has to do with links (feed, og:image, always ) points me to http all the time http://0.0.0.0:4000

I have already tried adding the --host https://mydomain.github.io to the jekyll command but it still doesn’t work. The most I have achieved is that it does something similar to

http://0.0.0.0:4000/https://mydomain.github.io

From what I have been able to see, everything comes from the absolute_url variable but I don’t know where this value comes from to be able to modify it.

I can’t think of anything to look at anymore. Does anyone have any idea where the problem could be?

Thank you so much

are you uploading the site folder to GH? normally you would upload the source and not the site and then jekyll would build on GH.

Also bundle exec jekyll serve build seems like a strange command - do one or the other (serve or build) - serve is for local development and will have localhost as the url for the domain, build is for the actual site to deploy.

Your 0.0.0.0 domain is coming from the jekyll serve command most likely.

What I do, and what I did before, was upload only what was in '_site'.

Which is what I did with the old theme I had from jekyll brutalist and everything worked correctly just as I want to do it now.

Of course, in the past, I did upload the entire folder, but I didn’t really like uploading the entire source code of my website and that’s why I changed to uploading only the resulting code, because I read that it could also be done.

And so what I do is create and validate the result on my localhost and then I upload the result.

Regarding code to compile/serve, this is what I found. That is not correct? How it should be done.

Can’t you use some plugin (I’ve read that github-pages exists) to reproduce what github would do and thus be able to upload the result of my site with all the correct links?

Likewise, regarding the jekyll save, is there a way to view the configuration I have right now, and can I change that configuration?

Thank you.

if you want to build locally and deploy the site folder you just need to do jekyll build - don’t do jekyll serve except for when you want to look at the site locally - the main difference in the urls. jekyll serve will have the url be localhost (or 0.0.0.0 or 127.0.0.1). If you then upload the site folder your urls may be wrong and have the 0.0.0.0 value.

jekyll build will use the url specified - there are lots of ways to build a url, it sounds like you are using the absolute url when you form a link?

If you do jekyll serve and make sure the site works locally, then do jekyll build and upload the site folder it should work.

You should go look inside the site folder and check a page when you do both commands to see that they are different. Each time you run one or the other it will nuke the whole site folder contents and re-write them.

Thank you very much for your help.

In the end I did what you told me, do tests to see what happens when it is used:

  • jekyll serve
  • jekyll build

And thanks to you, I have found the solution. Just as you said, when you do serve, everything is created but with data from localhost, on the other hand, when you use build, I have checked it more than 2 times because I couldn’t believe it, It uses, if you can say that, the configuration of the _config.yml file and all the links of the feed.xml, the robots.txt and the sitemap.xml are created perfectly following the domain that I have set in the url of config.

Thank you for all the help and clarifications you have given me.