Specying 'url: https://domain.com' has no effect


I’ve specified the url parameter in _config.yml

url: https://domain.com 

But nothing changes, and all weblinks on the site are still going to:<the page>

Is there another way to specify the hosts domain?

Unfortunately the container has been restarted; I even destroyed and recreated it from the compose. :frowning:

Here is my snippet for docker-compose:

    container_name: jekyll
    image: jekyll/jekyll:latest
    command: jekyll serve --config _config.yml --watch --force_polling --verbose --livereload
      - isolation
#    security_opt:
#       - no-new-privileges:true
       - Mars
    restart: always
      - $DOCKER_APPDATA/jekyll/mainsail_original/mainsail/docs:/srv/jekyll
      - 5676:4000

And the contents of _config.yml:

title: "Mainsail"
tagline: A web interface for Klipper
description: Mainsail is a lightweight & responsive web interface for the Klipper 3D printer firmware. It communicates with Moonraker (Klipper-API) from Arksine.
logo: "/assets/img/logo-mainsail.png"
# theme: just-the-docs
remote_theme: pmarsceill/just-the-docs
color_scheme: "mainsail"
search_enabled: true
  "Mainsail on GitHub":
    - "//github.com/meteyou/mainsail"
aux_links_new_tab: true

url: https://domain.com

      path: "" # an empty string here means all files in the project
      image: assets/img/rtfm.png

are you doing serve or build as the command? serve I think swaps out the url for localhost as it is for local dev.

Ah! Good point @rdyar@tomlawesome is using jekyll serve, which treats site.url differently depending on the version. Jekyll 4 always uses the given url, but Jekyll 3 ignores url in the default development mode. To force Jekyll 3’s serve command to use site.url, the production flag must be set like this:

JEKYLL_ENV=production jekyll serve ...
1 Like

However, the community feels the behavior in Jekyll 4.2.0 needs to be reverted…
ref: https://github.com/jekyll/jekyll/pull/7253#issuecomment-777653085
and https://github.com/jekyll/jekyll/pull/8620

Oh right. Wasn’t aware! Thank you guys, this works!

For clarity in case someone else searches the forum in future my situation is this:

  • Jekyll in a docker container
  • traefik reverse proxy pointing at the container
  • https://sub.domain.com hosting pointing at traefik
  • All links (other than main page) were pointing to

The fix for me, was to edit my compose snippet to add the following:

     - JEKYLL_ENV=production

Edit my _config.yml to include the following parameters:

url: https://sub.domain.com
baseurl: ''

Without the baseurl: ‘’ parameter the site would not load/build.

As an aside, I actually put the config in '_config.dev.yml and specified this config as an extra parameter in the serve command to overwrite/add to the original _config.yml allowing different settings to only apply if I serve jekyll with the command (in docker-compose snippet):

    command: jekyll serve --config _config.yml,_config.dev.yml --watch --force_polling --verbose --livereload