Add specs to test permalink summary truncation #389
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a PR to validate a bug in summary behavior. The behavior expected for summaries is as follows:
article.summary
is the first x number of characters.aritcle.body
has all content including the first x characters.READMORE
article.summary
is everything before separatorarticle.body
has all content AFTER separatorThis PR adds some tests that shows when in scenario 2 using a separator:
article.body
only strips out the separator but leaves in the summary content.As per documentation:
Looking around, I think most people don't use the separator. Instead the preferred method seems to be to add another front matter field to use for summary.
I tried a quick fix at
Middleman::Blog::BlogArticle
But this chopped the rendered html document in half instead.
I'm tossing this PR up in the hopes someone more knowledgable can present a fix.
I think it needs to be done further up the chain. Before the markdown content is rendered. Because middleman-core handles markdown rendering in a separate repo I'm not sure it's wise to directly edit that file for the edge case of blogging. Maybe monkeypatch that class to strip the summary content before rendering? If we monkeypatched into the content before rendering, we might be able to remove Nokogiri dependency. Since then we'd have access to the text from the markdown file before it gets rendered into html.