Where Does layout: default Go When There's no default.html?

The title pretty much says it… asks it, more accurately.

I have a site I built and have been maintaining for a couple of years and just today, I realized my default.html was actually named _default.html (with a leading underscore). Much to my surprise, when I renamed it to default.html, the site blew up. I deleted the file and the site came back to life.

Thus, my questions:

  1. Where does Jekyll get the high-level HTML wrapper code when there’s no default.html? It must come from somewhere because it’s in the generated files contained in the _site directory.
  2. Is Jekyll quick enough on its feet to whip up this code all on its own?
  3. If not, where does it come from? I’ve done an Agent Ransack search of the entire site structure, but found nada… nothing… zilch… sweet FA…

Typically, default.html is defined in a site’s theme. Are you using a theme? (look in _config.yml for the theme: field).

If you’re using a theme, then you can find the theme’s gem location with gem info or bundle info. For example, for Jekyll’s default Minima theme:

$ bundle info minima
  * minima (2.5.1)
	Summary: A beautiful, minimal theme for Jekyll.
	Homepage: https://github.com/jekyll/minima
	Path: /usr/local/lib/ruby/gems/2.7.0/gems/minima-2.5.1

In this case, the default layout is at: /usr/local/lib/ruby/gems/2.7.0/gems/minima-2.5.1/_layouts/default.html

1 Like

Ah! Thanks, Chuck. That clears things right up.

2 Likes