Skip to content

feat: drafts #177

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

Open
rochacbruno opened this issue Dec 2, 2024 · 3 comments
Open

feat: drafts #177

rochacbruno opened this issue Dec 2, 2024 · 3 comments
Labels

Comments

@rochacbruno
Copy link
Owner

As a blog writer I want to be able to create drafts by simply

cd myblog

touch drafts/mydraft.md
# OR
marmite --new "my draft" --draft
  • Drafts are posts that lives on input_folder/drafts
  • Inside drafts folder there is a media/ that symlinks the content_dir/media if exists

When building the site, if --drafts is passed, then those posts are collected.

@rochacbruno rochacbruno added the LOW label Dec 2, 2024
@neiesc
Copy link

neiesc commented May 18, 2025

Hi @rochacbruno , can I help this?

@rochacbruno
Copy link
Owner Author

Sure @neiesc

And I am thinking again, and we can do it simpler.


How to make a draft

To make a draft simply name your file with draft- prefix as in draft-2025-01-01-blog-post.md
or name the file whatever you want and put draft: true in the front matter.

How draft is set?

When draft is detected from name or front matter, the Content draft attribute is set to True, this by default is set to False.

How to preview a draft?

Run marmite with --preview argument and then the files matching draft: true will be included in the document collection and the prefix draft- if found in filename will be removed from final URL.

How to publish drafts to a different stream?

Set draftstream to True in the config and marmite will render a drafts.html and all drafts will be published to that stream, that stream will show the drafts fully rendered.

NOTES: Drafts are not included in the search index, drafts.html are excluded from search in the robots.txt, drafts stream does not generate feeds.

How to publish a draft?

  • Run marmite input output --publish slug (this will simply rename the file or flip the draft: attribute)
  • Or manually rename the file or remove the draft: true attribute from it

@neiesc
Copy link

neiesc commented May 24, 2025

perfect thx, I`ll do this

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

No branches or pull requests

2 participants