jekyll-admin
jekyll-admin copied to clipboard
Support for layout metadata [enhancement request]
layout is almost required for every page/post, but still needs to be added manually with JekyllAdmin
Instead, layout should be present as a dedicated field for all pages/posts, similar to Title, with a select drop-down to choose from: default [list all other layouts present in site] none
Thanks!
That's a nice suggestion @mariusa
What about default front matters?
When creating a new page, the pre-selected value in the layout dropdown should match the default set in _config.yml
Ideally, but this is another issue, if there's a default set and the chosen layout matches the default, the page shouldn't have the layout property at all (since the default is used)
This issue has been automatically marked as stale because it has not been commented on for at least two months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.
huh?
I agree. This must be solved!
If I create want to create a new post, by pressing on the "New Post" button. I should by default add the layout meta data with the value post.
@danger89 The recent versions of Jekyll Admin renders a dropdown that allows selection through layouts available in the site.
Besides, since Jekyll core doesn't enforce the condition that layout: post is meant for posts and posts alone, I don't see the need to auto-populate the layout metadata field.
Well without layout defined, using the default theme. It won't render the site correctly. For people with less knowledge (assuming they are using this admin panel).
This is not user friendly whatsoever. Also the knowledge of the post tag is not available for those users.
@danger89 Perhaps I'm not understanding your concern enough. Please walk with me via following steps and let me know where you (assumed to be a novice user) get stuck..:
- create new site by running
jekyll new admin-site --skip-bundleon a terminal window. - Add
gem "jekyll-admin", "~> 0.10"undergroup :jekyll_pluginsin the Gemfile. - On the terminal window, run
cd admin-site && bundle install - Run dev server by executing
bundle exec jekyll serve - Navigate to
http://localhost:4000/admin/in browser - Click
Postsin the sidebar. - Click
New Postin the content window. - Scroll down >> Click on
New metadata field>> enterlayoutin the input field and click elsewhere. - Notice a dropdown rendered next to the input field.
Sure; I will explain it in more detail. I'm using Jekyll as a Wordpress alternative for a site that get managed by inexperienced user, with minimal to no knowledge about Jekyll or markdown files. The person can create articles in Wordpress without issues.
When using Jekyll-admin the user need to know about the fact they need to enter the layout field manually with post as a value (which is not general knowledge to expect from inexperienced users). Otherwise the page is broken (with the default theme).
It's important to understand for what people you are creating Jekyll-admin. I expect most end-users would not be very experienced with Jekyll and/or markdown, otherwise I expect the users to edit the markdown files directly.
Meaning the following steps should become obsolete once the user pressed the New Post button:
Scroll down >> Click on New metadata field >> enter layout in the input field and click elsewhere.
Notice a dropdown rendered next to the input field.
And be replaced by:
- By default the layout is 'post', and people can use the dropdown menu to select another layout if they want.
After all, the button is called 'New Post'.
Thanks! Let me know what your plans are. 👍🏽
Regards, Melroy van den Berg
It's important to understand for what people you are creating Jekyll-admin. I expect most end-users would not be very experienced with Jekyll and/or markdown, otherwise I expect the users to edit the markdown files directly.
While the maintainers of this plugin does consider the very beginner Jekyll-user as part of the target demographic, this plugin cannot be considered an alternative to the more powerful / flexible Wordpress CMS. We expect the users to have basic knowledge about the authoring aspects of Jekyll.
Meaning the following steps should become obsolete once the user pressed the
New Postbutton...
I see. Since Jekyll will issue a warning (in the terminal console) for layouts that do not exist, setting a layout automatically could result in warnings that will confuse the novice user. So in theory, what we can do is have the layout: post set automatically if that layout exists.
What you can do to help your novice client is set front matter defaults in their config file. However, they'll get warning messages if they switch to a theme with a layout named post.
Ow so there is already a way to set a default in the configs some how?
Note: The said defaults are for Jekyll, not specific to Jekyll Admin.
defaults:
- scope:
path: ''
type: posts
values:
layout: post
- scope:
path: ''
type: pages
values:
layout: page
More info at https://jekyllrb.com/docs/configuration/front-matter-defaults/
This is great. I think this is a good "workaround" to get default values in jekyll-admin. Thanks works as expected 👍🏽 !