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

Accessing un-published posts in a template? #2226

Closed
staxmanade opened this Issue Apr 13, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@staxmanade

staxmanade commented Apr 13, 2014

Hello,

New to Jekyll, but recently ported my blog to Octopress. And sorry if this should be posted over at Octopress instead, but it felt Jekyll related.

I'm working on a series about porting a blog from BlogSpot/Blogger to Octopress and found this post about creating a series template to live in _includes.

I've since modified the template and want access to un-published posts within the template. (or if this can be done through drafts - maybe I just need a tip on how to get them).

My end goal would be to get the following template to work.

Series Gist Template

Notice how I'm trying to use post.published == false to output (coming soon)...

This works when I use rake generate; rake preview but the (coming soon) posts don't show up immediately. There's some sort of delay before this gets generated, and I presume this is related to the preview rake task in Octopress (but haven't dug in enough). After some time if I refresh it will display what I want, but I'm pretty sure rake generate; rake deploy won't produce the same thing.

Is it possible to access un-published posts or possibly drafts - to accomplish something like this?


This article is Part 2 of 5 in a series about something awesome.

  • Part 1 - something awesome - Introduction
  • Part 2 - something awesome - (current) Step 1
  • Part 3 - something awesome - Step 2
  • Part 4 - something awesome - (coming soon) Step 3
  • Part 5 - something awesome - (coming soon) Wrapping up
@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Apr 14, 2014

Member

In the future, please ask questions of this nature over on jekyll/help.

Presently, only posts which are published are added to the site.posts array, so this isn't possible.

Member

parkr commented Apr 14, 2014

In the future, please ask questions of this nature over on jekyll/help.

Presently, only posts which are published are added to the site.posts array, so this isn't possible.

@parkr parkr closed this Apr 14, 2014

@staxmanade

This comment has been minimized.

Show comment
Hide comment
@staxmanade

staxmanade Apr 14, 2014

Thanks, and will do.

staxmanade commented Apr 14, 2014

Thanks, and will do.

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

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