-
Notifications
You must be signed in to change notification settings - Fork 273
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: pass MDX frontmatter title into page <title>
#292
feat: pass MDX frontmatter title into page <title>
#292
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://gatsby-theme-c-git-fork-emyarod-291-page-titles-not-usin-87b8d4.carbon-design-system.now.sh |
@emyarod this looks great thanks. Sorry I was experimenting with the Could you add optional description/keywords as well? I know brand center was asking for this. |
@vpicone just double checking, would optional description/keywords also be from MDX frontmatter? and would they be appended to the description/keywords from gatsby-config or would it be a replacement? |
@emyarod yeah, that'd be ideal |
If they don't specify in frontmatter, it needs to be undefined so as to not override the one from siteMetadata |
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.
Could you add a Frontmatter section to the Markdown docs (preferably at the top). The Markdown page itself should make use of the frontmatter title/description/keyword features as well for testing and demonstration.
3de440f
to
6d7af25
Compare
local build was taking a while so I haven't had a chance to preview this but I wrote a few statements about the frontmatter. let me know if I should add more info @vpicone |
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.
@emyarod I pushed a couple of updates, if you have a sec please review them
- The design language website uses the page title as it's title. I added a theme option to allow the developer to control the format of the title: site, page or append (title – pageTitle)
- Added your change to the Homepage template so it's title could be controlled as well.
@@ -148,14 +148,16 @@ To add a link to the bottom of each page that points to the current page source | |||
|
|||
- `additionalFontWeights` – add support for additional Plex font weights. Don't forget to specify italics for the additional weights if needed. | |||
- `mdxExtensions` – change the file extensions processed by `gatsby-mdx` (default ['.mdx', '.md']) | |||
- `titleType` – the format of the title in your head. `site` for your site title, `page` for your individual page title, or `append` for "title – pageTitle" (default 'page') |
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.
I think we need some examples here to make it easier to understand what each one means.
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.
@alisonjoseph added
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.
This looks good, just want some more docs/examples so it is a little more obvious what each title type means/does.
@vpicone yeah looks good to me. wasn't sure what kind of flexibility we were gonna offer WRT page title but this gives users more options. what's causing the lockfile changes though? |
@emyarod mdx had a patch bump while I was working on it, nothin major. Could open a seperate PR if you’d prefer |
@vpicone that's fine was just wondering what prompted the change |
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! thanks
this PR passes the MDX frontmatter title into the
<Meta>
component HTML title element. not sure how configurable we want this to be, but this is an option for getting dynamic page titles in the format we're looking for in the IDL site