Skip to content

Commit

Permalink
Rename default layout to base (jekyll#690)
Browse files Browse the repository at this point in the history
Merge pull request 690
  • Loading branch information
ashmaroli authored Feb 19, 2023
1 parent 32468f5 commit 401a0a9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,34 @@ Minima has been scaffolded by the `jekyll new-theme` command and therefore has a

Refers to files within the `_layouts` directory, that define the markup for your theme.

- `default.html` — The base layout that lays the foundation for subsequent layouts. The derived layouts inject their contents into this file at the line that says ` {{ content }} ` and are linked to this file via [FrontMatter](https://jekyllrb.com/docs/frontmatter/) declaration `layout: default`.
- `base.html` — The base layout that lays the foundation for subsequent layouts. The derived layouts inject their
contents into this file at the line that says ` {{ content }} ` and are linked to this file via
[FrontMatter](https://jekyllrb.com/docs/frontmatter/) declaration `layout: base`.
- `home.html` — The layout for your landing-page / home-page / index-page. [[More Info.](#home-layout)]
- `page.html` — The layout for your documents that contain FrontMatter, but are not posts.
- `post.html` — The layout for your posts.

#### Base Layout

From Minima v3 onwards, the base layout is named **`base.html`** instead of `default.html` to avoid confusing new users into
assuming that name holds special status.

Users migrating from older versions with customized `_layouts/default.html` are advised to rename their copy to
`_layouts/base.html`. Migrating users with additional customized layouts may either update front matter references to former
`default.html` layout or create a new `default.html` layout referencing the current `base.html`, whichever route being the
easiest:

```
---
# new `_layouts/default.html` for backwards-compatibility when multiple
# layouts have been customized.
layout: base
---
{{ content }}
```

#### Home Layout

`home.html` is a flexible HTML layout for the site's landing-page / home-page / index-page. <br/>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: default
layout: base
---

<div class="home">
Expand Down
2 changes: 1 addition & 1 deletion _layouts/page.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: default
layout: base
---
<article class="post">

Expand Down
2 changes: 1 addition & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: default
layout: base
---
<article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting">

Expand Down

0 comments on commit 401a0a9

Please sign in to comment.