Jekyll default installation doesn't have _layouts directory

10,196

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.

Share:
10,196
Admin
Author by

Admin

Updated on June 08, 2022

Comments

  • Admin
    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:

    enter image description here

    No layouts folder.. what's up with that? Everything works though. And it looks perfectly fine when run on localhost.

  • Admin
    Admin almost 8 years
    Perfect! Thank you very much :)
  • Toontje
    Toontje almost 8 years
    Is there a way to add a new Jekyll 3.2 website withouth the minima theme?
  • Ross
    Ross almost 8 years
    Yes, 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
    bozdoz over 7 years
    Is there any automatic way to do this? i.e. without downloading from github?
  • Ross
    Ross over 7 years
    You 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
    zachdyer over 7 years
    I don't see the themes folder for minima.
  • Ross
    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
    zachdyer over 7 years
    I 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
    Nic Aguirre over 7 years
    So 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
    Samuel about 7 years
    Interesting. Should I delete files in minima?
  • Jeremy Lynch
    Jeremy Lynch about 7 years
    You don't have to delete files in minima. The files in your project directory are preferentially used
  • Greconomist
    Greconomist over 6 years
    or you can use open $(bundle show minima) to access the minima files directly (works from mac terminals).
  • Yashu Mittal
    Yashu Mittal over 5 years
    Getting this message in terminal: bash: open: command not found
  • Finn
    Finn over 5 years
    @YashuMittal On Ubuntu/Linux, try xdg-open $(bundle show minima).
  • michael_teter
    michael_teter over 5 years
    To 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
    agent18 over 3 years
    This just seems to initiate the some directories. The default theme which we can edit is not present here.