-
Notifications
You must be signed in to change notification settings - Fork 0
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
Get markdown working on browse pages #367
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
pages/browse/index.js
Outdated
const truncateDescription = (desc = '', maxLength, isOpen) => { | ||
if (desc.length <= maxLength || isOpen) return { truncated: desc, cutOffIndex: desc.length } | ||
const lastSpaceIndex = desc.substring(0, maxLength).lastIndexOf(' ') | ||
const ellipsis = isOpen ? '' : '...' | ||
return { truncated: desc.slice(0, lastSpaceIndex) + ellipsis, cutOffIndex: lastSpaceIndex } | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this get moved to "utils/helpers.js"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes definitely, i just tried putting it back there and it worked! for some reason when i first tried that it didn't want to work for me.. but it was probably some other confounding error
Story
Gets markdown working on the browse page. Homepage will still use snippets.
Related
Expected Behavior Before Changes
Expected Behavior After Changes
Screenshots / Video
Browse page will use description with markdown
Video: https://share.zight.com/o0uOqZx2Featured services will still use snippet