You can clone with
So you don't have to specify the layout in every post.
Implemented here (without tests, sorry): http://github.com/henrik/jekyll/commit/77bf31c42c25c2f87c215348a816b730104fe820
Love the idea but it has some of your custom mods built in. If this could be sliced off based on the current HEAD and tested, I'm up for it :)
I'd love to see this. I often write the same piece of YAML boilerplate at the beginning of my posts. I was thinking of writing something similar but have not yet had time.
Adding this feature would do a tremendous amount toward sharing README.markdown, index.markdown file between the gh-pages/jekyll-rendered site, and the github 'inlined readme' feature. Appending front matter makes src files look ugly for example when navigating through the regular github views. If we had default layouts in jekyll and can write just plain markdown it would remain compatible with github's own system (and many other systems).
I've taken Henrik's commit, updated it to work under the current (0.5.4) tag, and added a few tests. It's available for review on the post_defaults branch of my fork: http://github.com/mikewest/jekyll/tree/post_defaults
I like the idea here, but what about a convention-over-configuration approach? Just have jekyll assume that all posts should be rendered with a "post" layout?
You could even go as far as assuming any page should get rendered with 'default' (disable with layout: false), but the omission of the front-matter would lead to some ambiguities in what gets processed and what gets copied verbatim to _site.
Note, however, that the implementation isn't layout specific. This actually allows you to set any bits of metadata across all posts. A default teaser text, or default author, or etc. I don't think we should limit ourselves to layout, or attempt to address the underlying request through a series of convention.
For the specific case of layout, I think the idea of conventionally assuming post is a fine solution for most sites that Jekyll probably deals with (and I would suggest simply using this patch, and hardcoding a base set of default values via the DEFAULT variable in jekyll.rb).
I've rebased the post_defaults branch of my fork off the new 0.5.6 tag. Nice to see some updates happening again! :)
This looks good. My plan is to get all of the major bugs fixed and then release 1.0. After that, this patch will go into 1.1.
Any news on this issue? Is this something that could be implemented using a plugin?
Perhaps it would be useful to have a set of conditional defaults triggered according to file structure:
For single files, the defaults can be overridden by specifying another layout in YAML front matter or setting the layout to false for no layout.
For file types (i.e. the above types), config.yml can be used to override each. For example, if the default name for the default layout was "default", then defaultlayout: application will change this to application. This will then make all layouts in the layout folder not named "application" nest themselves inside that. Unless of course layoutlayout is set to something else or disabled with by setting to false. Similarly, all files in the root folder would nest themselves inside of application.html.
This is super old. Closing it down.