-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add templates to doc pages and give docs home one - Default docs page template moved from `src/templates/doc-home.tsx` to `src/templates/doc.tsx`. A new homepage-specific (but currently identical) template has been added in its place. - Added frontmatter to docs home source to define the template - Docs now have a "template" field, which when defined changes the component used to make its page. This is a file relative to `src/templates` with the extension left off. This defaults to `doc`, or the file `src/templates/doc.tsx`. This is not currently on blog posts. * Add "card" and "cards" custom components to Docs * Create some example content with the new custom card components This is not intended to be final, but show off the general premise of how using custom components for this kind of layout would look like. The card and cards components are, on top of being fully stylable with CSS modules, capable of using arbitrary Markdown images or elements as the card "logo" when the `logo` prop is set to `true` (or anything truthy, like the string `"true"`). This works around the complexity of working in custom image capability by leaning on the one we already have in Markdown. To make a card with a logo, set the "logo" prop to true and make sure the first element in the card contains the image you want- this element will be set aside in its own div, with the rest of the contents displayed beside it using `flex` There are some quirks with Remark custom components, though: - custom components aren't indented - custom components must be contained to one line, including props. - custom components can include Markdown, but there must be an empty line between the transition. - self-closing tags aren't supported Should we use custom components more often, we can migrate to MDX (I actually already have a fully working branch with it that I made on my own time) which handles this syntax much more comfortably because it's designed around the concept. All our custom remark-based logic will cleanly port because MDX actually uses Remark in its pipeline. * Resolve TS issues in example * Remove doc home template and example images In an effort to make the current solution good enough to fit release, I've removed the alternate template since this branch currently favors custom components. * Add example images to all home cards, and remove example heading. * Remove images from cards in doc home content * Improve Cards and add href feature. Cards now accept a `href` prop, which turns the whole card into a link. This is our Link wrapper, so we get the same automatic `rel` and `target` setting for external links as well as Gatsby Link for internal ones. This link spans the whole card, and has some styling to go along with it. Currently the hover style is set to a slight grow animation, but it could be anything. Most of the `children`-modifying hackery has been removed in favor of wrapping all Cards. This also brings a degree of consistency to Cards, and we can apply indivual styles if the need arises. It's still needed for the Card Images, however, since newlines that show up in `children` are mandatory for how rehype's React and MD are separated. * Change doc home content - Make each Card a single link applied via the new `href` part - Add headings to each card - Remove card icons * Change hover animation to background-color Now they match the right side buttons, aside from the animated transition. * index: simplify and update content * Restyled by prettier (#1335) Co-authored-by: Restyled.io <[email protected]> * home page, get started - fix the link * docs index - change oder, cards should go first * home index: return use cases * card style: less contrast for the heading * docs home page: update cards text Co-authored-by: Ivan Shcheklein <[email protected]> Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
1 parent
299fa0a
commit 6c89356
Showing
9 changed files
with
178 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.