Comments (11)
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.
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.
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.
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.
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.
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.
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.
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.
Any news on this issue? Is this something that could be implemented using a plugin?
from jekyll.
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.
This is super old. Closing it down.
from jekyll.
Related Issues (20)
- feat: `jekyll.gemspec` and `.rubocop.yml` disagree about the Ruby version
- feat: Support other template engines via plugins
- [Docs]: The Jekyll Docs site is broken and always displays "Deployment" as the page heading. HOT 3
- [Docs]: Search on the Jekyll Docs site is broken HOT 2
- [Bug]: Starting with Ruby 3.4.0, csv will no longer be part of stdlib HOT 1
- [Bug]: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested HOT 3
- [Bug]: Builds err with segfault in `csv.rb`, called by `read_data_file` HOT 4
- [Bug]: “jekyll build –trace” actually hides backtrace
- [Bug]: Quickstart minimal example gives: ERROR, Invalid date HOT 4
- [Docs]: Remove my entry from the Wiki Sites HOT 4
- [Docs]:
- [Bug]: Error: undefined method `excerpt_separator' for #<Jekyll::Page> HOT 36
- [Bug]: Following the instructions on the home page results in "cannot load such file -- json (LoadError)" HOT 3
- No me funciona disqus en mi página HOT 1
- [Bug]: "undefined method `yaml_file?' for #<Jekyll::page @name="404.md"> in /_layouts/single/html HOT 16
- I initially had logic that was a lot more tolerant of `s`s. And then I ran into the [🥔 🐛 - potato bug](https://github.com/check-spelling/check-spelling/releases/tag/0.0.17-alpha) -- namely the plural of `potato` is not `potatos`. It was so embarrassing, since I learned the proper spelling in elementary school. It was also a big deal as a [Vice President suggested `potatoe` to a student](https://abcnews.go.com/Politics/video/june-15-1992-dan-quayle-misspells-potato-48017343).
- [Docs]:
- [Bug]: Unable to build website
- [Bug]: `permalink_ext': undefined method `end_with?' for {}:Hash
- [Bug]: error running "bundle exec jekyll s" HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jekyll.