To make my site work on the local server I have
baseurl: ""
to make it work on github, I need
baseurl: "/psionman_set"
How can I set it so that it work on both?
To make my site work on the local server I have
baseurl: ""
to make it work on github, I need
baseurl: "/psionman_set"
How can I set it so that it work on both?
You can leave it set in the config so when you start locally you’ll see the url in the console includes the path.
It’s actually a good way to test locally. Because I found before that setting a path as /main.js might work locally but fail on github pages. So then you would set {{ "/main.js" | relative_url }}
. That will insert base url for you
If you really want to drop the base url locally without code change you can set the value in config and then start locally as
jekyll serve --baseurl ''
That is an empty string override.
Even more advanced you could create a second config which is for local use only and read in the standard config and then the local config, using command line option. But that only makes sense if you want to override a few values locally and store them all in a config.
Solution 2 is perfect. Solution 1 fails for me because I get 404s all over the place