Reputation: 2320
I'm using Github pages/Jekyll for both my personal page as well as my project page.
I'm also using a custom domain, so something like username.github.io
redirects to mycustomdomain.com
.
Since I also have a gh-pages
branch for my projects, my project's page lives at mycustomdomain.com/myproject
.
However, I'd prefer if I could choose what this URL would be, for example, mycustomdomain.com/projects/myproject
.
Is there any way to do this, without copy/pasting the whole project my username.github.io
repository's projects
folder?
Upvotes: 3
Views: 1747
Reputation: 1328972
That should be what baseurl is for.
- Set
baseurl
in your_config.yml
to match the production URL without the host (e.g./example
, nothttp://jekyll.github.io/example
).- Run
jekyll serve
and go tohttp://localhost:4000/your_baseurl/
, replacingyour_baseurl
with whatever you setbaseurl
to in your_config.yml
, and not forgetting the trailing slash.- Make sure everything works.
Feel free to prepend your urls withsite.baseurl
.- Push up to your host and see that everything works there, too!
Upvotes: 4