Search code examples
jekyllgithub-pagescodespaces

env url in jekyll + codespaces confusing


I have a _config-dev.yml with the following content:

baseurl: ""
environment: development
url: "https://codespaces_url.app.github.dev/"

When I print {{ site.url }} in the template. This returns: http://0.0.0.0:4000/ so all url's fail.

I'm very confused.

On the production in github pages I use _config.yml I define

url: "https://name.github.io/repo/"

And here the url's are rendered fine.

What's going on with codespaces?


Solution

  • You should be able to set

    baseurl: "/repo"
    

    in the _config.yml and use {{ site.baseurl }} instead of {{ site.url }} in the templates.