Bot releases are hidden (Show)
Published by hashibot-web almost 2 years ago
626c559
Thanks @nandereck! - Adding fullscreen buttonPublished by hashibot-web almost 2 years ago
Published by BRKalow over 2 years ago
Full Changelog: https://github.com/hashicorp/swingset/compare/0.14.0...v0.14.1
Published by ztanner over 2 years ago
Published by BRKalow about 3 years ago
getPeerComponents
with updated component data structure (#33)Published by BRKalow over 3 years ago
docs.mdx
, not just the default export (#30)Published by BRKalow over 3 years ago
docsRoot
in the plugin optionsindex
to swingsetOptions
Here's what the implementation looks like now:
// in /pages/[[...swingset]].jsx
import createPage from 'swingset/page'
import { createStaticProps, createStaticPath } from 'swingset/server'
export default createPage()
export const getStaticPaths = createStaticPaths()
export const getStaticProps = createStaticProps({
/* mdxOptions = {} */
})
Published by BRKalow over 3 years ago
[email protected]
(#24)createStaticProps
: #20 (details)peerComponents
frontmatter attribute: #21 (details)/
from swingset page route: #19You can now pass mdxOptions
to swingset/createStaticProps
in order to customize the Markdown rendering on your documentation pages. The options are passed directly to the MDX compiler via next-mdx-remote
. For example, the following configuration would add code highlighting to any fenced code blocks:
import createPage from 'swingset/page'
import createStaticProps from 'swingset/getStaticProps'
import highlight from '@mapbox/rehype-prism'
export default createPage()
export const getStaticProps = createStaticProps({
mdxOptions: {
rehypePlugins: [[highlight, { ignoreMissing: true }]],
},
})
peerComponents
Previously, the only components available on a docs.mdx
page were the main component (componentName
in frontmatter), and any global components you pass to Swingset (like the default <PropsTable />
). Now, you can inject arbitrary components at the page level by specifying them in the new peerComponents
frontmatter attribute.
---
componentName: Button
peerComponents:
- AnimatedLoaderIcon
---
Welcome to the `Button` docs page! `Button` wraps its `children` in a button UI. Example:
<Button text="Click me">
<AnimatedLoaderIcon />
</Button>
Note: peerComponents
must also be present in Swingset (i.e., they have their own docs.mdx
page).
Published by BRKalow over 3 years ago
To pass in a custom logo use the logo
option when calling createPage
:
createPage({ logo: <MyLogo /> })
This release exposes a new packageJson
prop to each component's page scope, if that component has a package.json
in its component.path
.