Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/benbalter/jekyll-default-layout

Silently sets default layouts for Jekyll pages and posts
https://github.com/benbalter/jekyll-default-layout

github-pages jekyll jekyll-plugin

Last synced: 29 days ago
JSON representation

Silently sets default layouts for Jekyll pages and posts

Awesome Lists containing this project

README

        

# Jekyll Default Layout

*Silently sets default layouts for Jekyll pages and posts*

[![CI](https://github.com/benbalter/jekyll-default-layout/actions/workflows/ci.yml/badge.svg)](https://github.com/benbalter/jekyll-default-layout/actions/workflows/ci.yml)

## Usage

1. Add the following to your site's Gemfile:

```ruby
gem 'jekyll-default-layout'
```

2. And the following to your site's `_config.yml`:

```yml
plugins:
- jekyll-default-layout
```

Note: If you are using a Jekyll version less than 3.5.0, use the `gems` key instead of `plugins`.

## What it does

If no layout is specified for a Markdown post or page, the plugin automatically sets the "home", "post", "page", or "default" layout if it exists.

What layout is used:

* `/index.md` - the home layout, the page layout, or the default layout, if they exist, in that order
* A page - the page layout or the default layout, if they exist, in that order
* A post - the post layout or the default layout, if they exist, in that order

## Disabling

For a specific post or page, add `layout: null` to the front matter.