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

excerpt needs to fall back to pruneLength when no excerpt_separator #18312

Closed
fabianrios opened this issue Oct 8, 2019 · 8 comments · Fixed by #19137
Closed

excerpt needs to fall back to pruneLength when no excerpt_separator #18312

fabianrios opened this issue Oct 8, 2019 · 8 comments · Fixed by #19137
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more.

Comments

@fabianrios
Copy link

fabianrios commented Oct 8, 2019

Summary

excerpt falling back to pruneLength when there is no custom excerpt_separator on the file

Basic example

config.js

{
      resolve: `gatsby-transformer-remark`,
      options: {
        "excerpt_separator": `<!-- endexcerpt -->`
      }
    },

template.js

node {
          id
          excerpt(pruneLength: 140, format: MARKDOWN)
}

Motivation

I had to put a custom excerpt for just 2 files and the rest will look just fine with the default 140 pruneLength but it turns out it doesn't fall back so I have to manually edit hundreds of files to add a which wouldn´t have been necessary if the excerpt function just fall back to pruneLength when there is no in the file.

EDIT: Reproduction example here: samrae7/gatsby-remark-repro

@LekoArts LekoArts added help wanted Issue with a clear description that the community can help with. type: feature or enhancement labels Oct 17, 2019
@samrae7
Copy link
Contributor

samrae7 commented Oct 24, 2019

I would like to take this. Will work on it this weekend and post here if I get blocked.

@samrae7
Copy link
Contributor

samrae7 commented Oct 26, 2019

@fabianrios do your markdown files contain html or just plain markdown? Can you post an example of the formatting you have? Trying to reproduce this issue.

@samrae7
Copy link
Contributor

samrae7 commented Oct 26, 2019

@fabianrios ignore previous question. I have replicated the behaviour with markdown: https://github.com/samrae7/gatsby-remark-repro

@samrae7
Copy link
Contributor

samrae7 commented Oct 28, 2019

still working on this. PR coming in next couple of days

@fabianrios
Copy link
Author

happy to see action was taken, I lost track of this for a while.

@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Nov 28, 2019
@samrae7
Copy link
Contributor

samrae7 commented Dec 3, 2019

Awaiting reviewing response from @pieh

@samrae7
Copy link
Contributor

samrae7 commented Dec 3, 2019

@fabianrios can you review the PR as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more.
Projects
None yet
3 participants