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

Can Eleventy do conditional pubishing? #1378

Closed
zomars opened this issue Aug 26, 2020 · 3 comments
Closed

Can Eleventy do conditional pubishing? #1378

zomars opened this issue Aug 26, 2020 · 3 comments

Comments

@zomars
Copy link

zomars commented Aug 26, 2020

Hear me out. Sometimes I'm have some WIP markdown files that are not quite ready to publish (this would be the default for me).

Wouldn't it be cool to be able to have a markdown file and the when it's ready to publish simply adding something like this into the frontmatter data and use that condition to build the template?

Example:

---
published:  true
---

or maybe the desired published date:

---
publishedAt:  2020-08-25
---

Or something like that.

Is it possible? Sorry if this is a duplicate, I couldn't find anything in here.

@dz4k
Copy link

dz4k commented Aug 31, 2020

The following will prevent a file from being published:

---
permalink: no
eleventyExcludeFromCollections: yes
---

You could set these in a directory data file in a drafts/ folder.

@zachleat
Copy link
Member

I think this is the same as #188, please follow along over there!

@zachleat
Copy link
Member

Specifically this comment might be of value to you #188 (comment)

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

No branches or pull requests

3 participants