Using Github pages with Jekyll in a subdirectory

woutr_be

I recently wanted to publish my Jekyll site on Github pages, but it seems that putting everything in a subdirectory is giving some issues, even after I change the source to the correct directory.

My structure looks like this:

- site
   - src (contains all Jekyll stuff)
   - README.md
   - GruntFile.js
   - ...

Locally my site builds perfectly and when I go to http://localhost:4040 I can see it just nicely, but when I commit this to my Github and visit username.github.io I get a 404, if I go to username.github.io/src I can see part of my site, however all {% include %} are ignored.

In my _config.yml I updated the source: source: ./src, but that doesn't seem to help.

Is there a way to make Github Pages handle subdirectories properly? Basically I want to tell it that my Jekyll site is inside /src, and I want the url to just be username.github.io instead of username.github.io/src

I know i can use the pages branch and commit to there, but I would prefer if it could happen automaticly.

woutr_be

I contact Github support and they gave me 2 solutions.

  1. Move all my Jekyll source files to my top-lever directory.
  2. Use a different branch and update it manually each time.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Unable to set favicon using Jekyll and github pages

using jQuery with Jekyll site hosted on Github pages

Understanding Jekyll and the gh-pages branch when using GitHub Pages

404 page not working with permalink: pretty using GitHub Pages + Jekyll

Get a blank page after pushing a site using Github pages with Jekyll

Variables available when building static sites using jekyll and github pages

create a Jekyll GitHub blog as a subdirectory of an Organization

Github pages jekyll images not loading

Installing Jekyll 3.8.5 on GitHub Pages

Jekyll on Github Pages not rendering CSS

Setting Jekyll environment for GitHub Pages

Animation on jekyll run github pages

Problem with GitHub Pages Jekyll Template

GitHub Pages Jekyll theme working for pages but not for posts

How to separate posts by pages on Jekyll GitHub Pages?

Rendering a GitHub wiki on a GitHub Pages Jekyll site

Set subdirectory as website root on Github Pages

im using github pages with jekyll using liquid syntax. there is weird thing

Github Pages and Jekyll permalinks going to different paths

Jekyll (for GitHub Pages): How to create a carousel of Divs?

Generate category page in jekyll targeting github pages

Jekyll includes not working in GitHub Pages without a template

How to prevent jekyll build on github pages

GitHub Pages Jekyll won't build

running jekyll locally on a github pages site project

Jekyll collection not working on github.pages

GitHub Pages and Jekyll content duplication and SEO issues

Github pages w/ Jekyll 404 on specific page

Post permalinks not being parsed in Jekyll on GitHub Pages