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

Improve handling non-default collection documents rendering and writing #6795

Merged
merged 3 commits into from Mar 10, 2018

Conversation

Projects
None yet
5 participants
@ashmaroli
Member

ashmaroli commented Feb 21, 2018

Resolves #5953
Replaces #6506

  • implement patch
  • update cucumber feature and unit test
  • update documentation

@ashmaroli ashmaroli added this to the v3.8.0 milestone Feb 21, 2018

@ashmaroli ashmaroli requested review from mattr-, DirtyF, pathawks and oe Feb 21, 2018

When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "Newest puppy: Fido" in "_site/index.html"

This comment has been minimized.

@DirtyF

DirtyF Feb 21, 2018

Member

Why do we return a future document here?

This comment has been minimized.

@ashmaroli

ashmaroli Feb 21, 2018

Member

I've documented the behavior in _docs/collections.md

This is based on #6506 (comment) and #6506 (comment) by @pathawks.
You can iterate through future docs but won't be output / written to disk

This comment has been minimized.

@ashmaroli

ashmaroli Feb 21, 2018

Member

If this a breaking-change in behavior, we can ship this in 4.0.. no biggie

This comment has been minimized.

@DirtyF

DirtyF Feb 21, 2018

Member

@pathawks use case with future events makes sense.
Hugo's date, publishdate and expirydate is way more flexible.

This comment has been minimized.

@ashmaroli

ashmaroli Feb 21, 2018

Member

If Pat Hawks use case is possible on master then this PR is safe to ship in 3.x otherwise its probably a 4.0

This comment has been minimized.

@pathawks

pathawks Feb 21, 2018

Member

On master, future docs are rendered and can be accessed, but are not written to disk. 👍

docs << Document.new(full_path, :site => site, :collection => self).tap do |doc|
doc.read
if !site.publisher.publish?(doc) && site.publisher.hidden_in_the_future?(doc)
Jekyll.logger.debug "Skip Publishing:", "#{doc.relative_path} has a future date"

This comment has been minimized.

@pathawks

pathawks Feb 21, 2018

Member

I am unable to trigger this log message. Perhaps I am misunderstanding.

Needed -V

jekyll/cases@0c7256b

This comment has been minimized.

@ashmaroli

ashmaroli Feb 21, 2018

Member

can you post the entire verbose build output under the commit? Thanks

This comment has been minimized.

@pathawks

pathawks Feb 21, 2018

Member

verbose is the key word. 🤕

@ashmaroli ashmaroli changed the title from Write future-dated docs only if site.future is true to Write future-dated docs only if `site.future` is true Feb 21, 2018

<p>Except for documents in hard-coded default collection <code>posts</code>, all documents in collections
you create, are accessible via Liquid irrespective of their assigned date, if any, and therefore renderable.
</p>
<p>However documents are attempted to be physically output (written to disk) only if the concerned collection

This comment has been minimized.

@oe

oe Feb 21, 2018

Member

just say written to disk here

metadata has <code>output: true</code>. Additionally, future-dated documents are only written if
<code>site.future</code> <em>is also true</em>.
</p>
<p>A more fine-grained control over documents being written to disk can be further excercised by setting

This comment has been minimized.

@oe

oe Feb 21, 2018

Member

More fine-grained control [...]

@oe

This comment has been minimized.

Member

oe commented Feb 21, 2018

The title is kind of misleading, no? There's more than that added in this PR.

@ashmaroli

This comment has been minimized.

Member

ashmaroli commented Feb 22, 2018

The title is kind of misleading, no?

Feel free to change the title to something that fits the proposed changes.

@ashmaroli

This comment has been minimized.

Member

ashmaroli commented Feb 22, 2018

Improve handling non-default collection documents rendering and writing

@DirtyF DirtyF changed the title from Write future-dated docs only if `site.future` is true to Improve handling non-default collection documents rendering and writing Mar 8, 2018

@DirtyF

DirtyF approved these changes Mar 8, 2018

@DirtyF DirtyF added the fix label Mar 8, 2018

@DirtyF

This comment has been minimized.

Member

DirtyF commented Mar 8, 2018

…waiting for @oe approval before merging this fix.

@oe

oe approved these changes Mar 9, 2018

Approval!

@DirtyF

This comment has been minimized.

Member

DirtyF commented Mar 10, 2018

@jekyllbot: :shipit: +fix

@jekyllbot jekyllbot merged commit f8a66ca into jekyll:master Mar 10, 2018

3 checks passed

WIP ready for review
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jekyllbot jekyllbot added bug fix labels Mar 10, 2018

@ashmaroli ashmaroli deleted the ashmaroli:future-dated-docs branch Mar 11, 2018

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