Code Monkey home page Code Monkey logo

jekyll-default-layout's Introduction

Jekyll Default Layout

Silently sets default layouts for Jekyll pages and posts

CI

Usage

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

    gem 'jekyll-default-layout'
  2. And the following to your site's _config.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.

jekyll-default-layout's People

Contributors

benbalter avatar dependabot-preview[bot] avatar dirtyf avatar dpgao avatar kenman345 avatar supercilex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jekyll-default-layout's Issues

Support for HTML pages

It would be cool if it supported HTML pages, and not just MD!

Thanks for the plugin either way!

Support for HAML (or other renderers in general?)

Is your feature request related to a problem? Please describe the problem you're trying to solve.

I would like to use jekyll-default-layout together with jekyll-haml-markup

Describe the solution you'd like

It should work

Describe alternatives you've considered

Using Markdown, I guess?

Additional context

Well, it's not working with .haml files.

Also apply default layout to Collections

Hi Ben!

Thanks for the great plugin. I just got into Jekyll and this has made it really easy to write simple sites that anyone can edit without messing it up!

On my site I have some collections which are set to output : true but they don't implicitly get the default layout (they end up with no layout). I tried hacking the plugin myself to add collections into the documents list:

def documents
  [site.pages, site.posts.docs, site.collections.docs].flatten
end

But I'm new to ruby and jekyll so I think I made a bad assumption about the data types or API involved; the error says theree is no docs on collections (it looked from the source for collections.rb like there was...)

If this would be easy to implement it would add tons of value for me (hopefully others?) or if you could point me in the right direction to hack my own fork that would also be tremendous ๐Ÿ‘

Thanks again,
Ste

Support For Collections

Is your feature request related to a problem? Please describe the problem you're trying to solve.

Currently if you have pages in a collection, this gem does not apply the layout automatically

Describe the solution you'd like

Support for collections

Describe alternatives you've considered

Alternative is specifying the layout in the frontmatter

Additional context

I've put together an example of this using the just-the-docs template.
Repo: https://github.com/halorrr/collections-test
Site: https://halorrr.github.io/collections-test/

You can see when visiting the site everything looks as expected initially:
https://halorrr.github.io/collections-test/
image

If you click the Collection Test Layout page which has the layout specified in the frontmatter, it will also look normal:
image

But if you click the Collection Test No Layout page which does not have the layout specified in the frontmatter you will see not layout is applied:
image

This was a very basic test, setting up the collection the way that Just The Docs suggests:
https://just-the-docs.com/docs/configuration/#document-collections which you can see in the example config here:
https://github.com/halorrr/collections-test/blob/main/_config.yml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.