-
Notifications
You must be signed in to change notification settings - Fork 81
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
feat: implement short description in page content header #1822
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/contentful-apps/forma-36/pVdoiFGhB6Tp3FCHQUDvta1kmNtR |
3d43f08
to
9dfdc5e
Compare
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.
Looks good! A bit hacky, but if we want to have it working out of the box, there are not many other ways.
My only concern is that it could be challenging to come up with a short and concise description for every component. Sometimes one line sentence is not enough.
980fe27
to
c22ee9f
Compare
c22ee9f
to
d791e84
Compare
Purpose of PR
/components
and it exports only the thing used by files outside of that folderI managed to create a system to edit the header of the content easily without us losing any features of MDX
Basically, during the creation of the page, we will extract from the MDX file everything that comes before a heading (a sentence in mdx that starts with
#
)In this example, everything after the frontmatter and before "## Import" will be extracted and stored in a prop to be used later by
PageContentHeader
If the page has a "shortIntro" we will render another MdxRenderer in the PageContentHeader with the text we selected earlier
This system is good because it will work immediately with every page and it does not change how we write the pages
... but that's also a problem, when I say it works in every page I meant EVERY PAGE
E-V-E-R-Y P-A-G-E
That's why I'm going trough every page and adding some headings or moving the content to avoid this huge headers with tables and lists
WDYT?
PR Checklist
readme.md
file(s)