Jekyll default installation doesn't have _layouts directory
Solution 1
You must be running the recent Jekyll version 3.2, which introduces Gem based themes (from https://jekyllrb.com/docs/themes/):
Jekyll themes package layouts, includes, and stylesheets in a way that can be overridden by your site’s content.
The theme is set in _config.yml:
theme: minima
Initial files that were previously in _layouts
, _includes
, and _sass
are now packaged with the theme.
Solution 2
Basically Jekyll wants you to use themes, so you can't see _layouts
, _includes
, _sass
, _assets
anymore.
To use previous behaviour simply copy from the gemfile:
open $(bundle show minima)
Copy the 4 folders into your jekyll directory
Solution 3
If you want the older style of Jekyll website directory which includes all the 4 folders then you can use this command :
jekyll new my-new-website-name --blank
I have done the same while creating a personal site.
Admin
Updated on June 08, 2022Comments
-
Admin almost 2 years
So I followed the guide on the Jekyll website by installing and running Jekyll (sure I don't have to post this here). And the site is up and running perfectly but for some reason I don't see the
_layouts
directory that's supposed to be there. In the pages I can see that it references some layouts i.e:index.html
--- layout: default --- <div class="home">
about.md
--- layout: page title: About permalink: /about/ --- This is the base Jekyll theme.
But when you look at the directory stucture of the project:
No layouts folder.. what's up with that? Everything works though. And it looks perfectly fine when run on localhost.
-
Admin almost 8 yearsPerfect! Thank you very much :)
-
Toontje almost 8 yearsIs there a way to add a new Jekyll 3.2 website withouth the minima theme?
-
Ross almost 8 yearsYes, just remove the
theme: minima
line from your_config.yml
. You could copy the theme files to your site as well if you wanted to keep the starting point: github.com/jekyll/minima -
bozdoz over 7 yearsIs there any automatic way to do this? i.e. without downloading from github?
-
Ross over 7 yearsYou could copy the files from where bundle installs them instead. I've been using an older version of Jekyll to generate new sites:
jekyll _3.0.3_ new .
(assuming macOS with Jekyll 3.0.3 installed). -
zachdyer over 7 yearsI don't see the themes folder for
minima
. -
Ross over 7 years@zachdyer I'm not sure what you mean. If you're still having issues it's probably better to ask in a new question.
-
zachdyer over 7 yearsI guess I didn't have the minima theme installed. However I solved the problems I was having by deleting the gem files and adding the
_layouts
folder and other Jekyll folders to the root directory. Then it started working just fine. -
Nic Aguirre over 7 yearsSo if I want to build off of the minima theme, say adding a header.html include, how would I go about doing this? Would I have to make a new theme entirely?
-
Samuel about 7 yearsInteresting. Should I delete files in minima?
-
Jeremy Lynch about 7 yearsYou don't have to delete files in minima. The files in your project directory are preferentially used
-
Greconomist over 6 yearsor you can use
open $(bundle show minima)
to access the minima files directly (works from mac terminals). -
Yashu Mittal over 5 yearsGetting this message in terminal:
bash: open: command not found
-
Finn over 5 years@YashuMittal On Ubuntu/Linux, try
xdg-open $(bundle show minima)
. -
michael_teter over 5 yearsTo clarify then, if one wants to make additions or modifications to their layouts, they must either manually create folders and copy files from somewhere under _site, or they must modify a gem and maintain a custom gem? If so, both options seem quite user-unfriendly. A step or two more in that direction and we might as well just hand-code a site like we used to.
-
agent18 over 3 yearsThis just seems to initiate the some directories. The default theme which we can edit is not present here.