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

Whole-post excerpts should match the post content #4004

Merged
merged 1 commit into from
Oct 16, 2015
Merged

Whole-post excerpts should match the post content #4004

merged 1 commit into from
Oct 16, 2015

Commits on Oct 1, 2015

  1. Whole-post excerpts should match the post content

    When a post does not contain an excerpt_separator, meaning the excerpt
    includes the entire post, the excerpt should contain exactly the post
    content.
    
    This is desirable both from a correctness standpoint, that the excerpt
    should not introduce any new content, and more practically to allow fast
    and easy detection of whole-post excerpts in Liquid templates using
    `post.excerpt == post.content`.  A common use-case is deciding whether
    to render "Read More" links on a page containing post excerpts.
    
    This commit does exactly that.  It avoids adding additional newlines to
    the excerpt content when the excerpt includes the whole post and adds
    tests to ensure that this behavior is correct and preserved going
    forward.
    
    Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
    kevinoid committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    bb9462f View commit details
    Browse the repository at this point in the history