Reputation: 121
I started to make my blog with jekyll and github pages.
I was doing fine with the basic theme, But I wanted to apply the side bar property, so I downloaded the theme which has the sidebar, from https://idratherbewriting.com/documentation-theme-jekyll/
So I downloaded the proejct and overrided. I don't know much about how this works, but the strangest thing is that in index.md file
if I put
---
layout:home
sidebar:mydoc_sidebar
----
it happens to show the basic theme layout and the posts as it should be, but if I change the layout to something else which is inside the _layout folder such as post, default, the posts disappear and I have no idea why Jekyll does this.
Even when I erase the layout, it returns empty screen so I'm sure it's doing something with the home layout but I couldn't find anywhere how the home layout is rendered.
Upvotes: 4
Views: 1145
Reputation: 52809
In _config.yml, we can see that you are using (theme: minima
) the minima gem based theme (documentation). That means that by default, all your _includes, _layouts and assets are hidden somewhere on you computer. You can use the bundle show minima
command to find out where they are stored.
As home layout exists in minima theme, is it used.
If you want to use your own home layout you can copy it from minima to your _layouts folder and modify it to suits your needs.
cd your/root
cp `echo "$(bundle show minima)/_layouts/home.html" _layouts/home.html`
If you want to be sure not to use hidden resources, you can delete the theme: minima
directive from your _config.yml file.
Upvotes: 5
Reputation: 1618
this issue can be caused by several factors but it is possible there's no issue at all :)
1) Stop Jekyll serve/watch.
2) Delete the _site
directory.
3) Rebuild and serve the site
jekyll serve
.
Keep an eye on the terminal to see if Jekyll warns you about the missing layout file.
It is possible, albeit unlikely that the theme or a plugin id building layouts on the fly. To override this (whether it is the case or not), create a home
layout as usual and include in a page/post's front-matter. Just keep the layout basic with something like a red background so that you can easily test if it is loaded or not.
I think deleting the _site
folder will fix this but if not, try the other option and let me know.
Upvotes: 0