Git Product home page Git Product logo

Comments (11)

qrush avatar qrush commented on May 13, 2024

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 :)

from jekyll.

mreid avatar mreid commented on May 13, 2024

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.

from jekyll.

dreamcat4 avatar dreamcat4 commented on May 13, 2024

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).

from jekyll.

mikewest avatar mikewest commented on May 13, 2024

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

from jekyll.

matschaffer avatar matschaffer commented on May 13, 2024

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.

from jekyll.

mikewest avatar mikewest commented on May 13, 2024

Good idea!

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).

from jekyll.

mikewest avatar mikewest commented on May 13, 2024

I've rebased the post_defaults branch of my fork off the new 0.5.6 tag. Nice to see some updates happening again! :)

http://github.com/mikewest/jekyll/tree/post_defaults

from jekyll.

mojombo avatar mojombo commented on May 13, 2024

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.

from jekyll.

bdesham avatar bdesham commented on May 13, 2024

Any news on this issue? Is this something that could be implemented using a plugin?

from jekyll.

rupert-madden-abbott avatar rupert-madden-abbott commented on May 13, 2024

Perhaps it would be useful to have a set of conditional defaults triggered according to file structure:

  • _layouts: The default layout has no layout. All other layouts automatically nest themselves inside the default layout
  • Any other content folder prefixed by _: Uses the layout with name identical to anything following that prefix. So _categories would use categories.html. _posts would use posts.html
  • Anything else uses the default layout

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 default_layout: 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 layout_layout 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.

from jekyll.

qrush avatar qrush commented on May 13, 2024

This is super old. Closing it down.

from jekyll.

Related Issues (20)

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.