Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front Matter Variables: "Draft" type not recognized? #2726

Closed
rocketspops opened this issue Aug 11, 2014 · 5 comments
Closed

Front Matter Variables: "Draft" type not recognized? #2726

rocketspops opened this issue Aug 11, 2014 · 5 comments

Comments

@rocketspops
Copy link

In config.yml I have:

defaults:
  -
    scope:
      path: ""
    values:
      layout: "default"
  -
    scope:
      path: ""
      type: "draft"
    values:
      tags: "draft"
  -
    scope:
      path: ""
      type: "post"
    values:
      type: "post"

For some reason, I can't get Jekyll to respect the second block. I'm trying to tag all drafts with the tag "draft," but I'm not having much luck. The first and third blocks are working.

Any ideas?

@pathawks
Copy link
Member

Unfortunately, it doesn't look like this is supported.

If Jekyll is run with --drafts, than drafts are processed the same way as posts (so type: post); if not run with --drafts then drafts are not processed at all.

@rocketspops
Copy link
Author

Argh, that's too bad. The documentation is confusing:

Now, this will only set the layout for files where the type is post. The different types that are available to you are page, post, draft or any collection in your site. While type is optional, you must specify a value for path when creating a scope/values pair.

@pathawks
Copy link
Member

Am I wrong? I’d love to be wrong.
Otherwise, the docs need to change.

@parkr parkr closed this as completed in 9c090c8 Aug 12, 2014
@simba4everyoung
Copy link

I had the same problem in Jekyll 3.0.0.
I want to set default author for drafts. In my _config.yml I have:

defaults:
    -
        scope:
            path: "" 
            type: "drafts" 
        values:
            author: Simba Draft
            layout: "post"

    -
        scope:
            path: "" 
            type: "posts" 
        values:
            layout: "post"

I tried this, also tried setting posts before drafts. I can't get drafts' author set. All the posts are without author now.
Is there anything wrong? Or how should I do it?

@parkr
Copy link
Member

parkr commented Oct 29, 2015

@simba4everyoung Please open a new issue for this. Drafts are now a part of the posts collection so it's not possible to specify just drafts in 3.0.0. We will want to fix so please open a new issue (and reference this one).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants