Skip to content

Commit 401a0a9

Browse files
authored
Rename default layout to base (#690)
Merge pull request 690
1 parent 32468f5 commit 401a0a9

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,34 @@ Minima has been scaffolded by the `jekyll new-theme` command and therefore has a
3333

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

36-
- `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`.
36+
- `base.html` — The base layout that lays the foundation for subsequent layouts. The derived layouts inject their
37+
contents into this file at the line that says ` {{ content }} ` and are linked to this file via
38+
[FrontMatter](https://jekyllrb.com/docs/frontmatter/) declaration `layout: base`.
3739
- `home.html` — The layout for your landing-page / home-page / index-page. [[More Info.](#home-layout)]
3840
- `page.html` — The layout for your documents that contain FrontMatter, but are not posts.
3941
- `post.html` — The layout for your posts.
4042

43+
#### Base Layout
44+
45+
From Minima v3 onwards, the base layout is named **`base.html`** instead of `default.html` to avoid confusing new users into
46+
assuming that name holds special status.
47+
48+
Users migrating from older versions with customized `_layouts/default.html` are advised to rename their copy to
49+
`_layouts/base.html`. Migrating users with additional customized layouts may either update front matter references to former
50+
`default.html` layout or create a new `default.html` layout referencing the current `base.html`, whichever route being the
51+
easiest:
52+
53+
```
54+
---
55+
# new `_layouts/default.html` for backwards-compatibility when multiple
56+
# layouts have been customized.
57+
58+
layout: base
59+
---
60+
61+
{{ content }}
62+
```
63+
4164
#### Home Layout
4265

4366
`home.html` is a flexible HTML layout for the site's landing-page / home-page / index-page. <br/>
File renamed without changes.

_layouts/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: default
2+
layout: base
33
---
44

55
<div class="home">

_layouts/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: default
2+
layout: base
33
---
44
<article class="post">
55

_layouts/post.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: default
2+
layout: base
33
---
44
<article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting">
55

0 commit comments

Comments
 (0)