Browse Source

fix: redirects, memos

fix/enable-imgix
Thomas Osmonson 4 years ago
parent
commit
60418ed23e
  1. 241
      next.config.js
  2. 4
      package.json
  3. 83
      src/components/custom-blocks/page-reference.tsx
  4. 2
      src/components/footer.tsx
  5. 4
      src/components/mdx/components/heading.tsx
  6. 4
      src/components/search.tsx
  7. 4
      yarn.lock

241
next.config.js

@ -96,52 +96,200 @@ async function redirects() {
destination: '/smart-contracts/running-a-testnet-node', destination: '/smart-contracts/running-a-testnet-node',
permanent: true, permanent: true,
}, },
{ source: '/core/smart/cli-wallet-quickstart.html', destination: '', permanent: true }, {
{ source: '/core/naming/introduction.html', destination: '', permanent: true }, source: '/core/smart/cli-wallet-quickstart.html',
{ source: '/core/naming/architecture.html', destination: '', permanent: true }, destination: '/smart-contracts/cli-wallet-quickstart',
{ source: '/core/naming/namespaces.html', destination: '', permanent: true }, permanent: true,
{ source: '/core/naming/comparison.html', destination: '', permanent: true }, },
{ source: '/core/naming/tutorial_subdomains.html', destination: '', permanent: true }, {
{ source: '/core/naming/search.html', destination: '', permanent: true }, source: '/core/naming/introduction.html',
{ source: '/core/faq_technical.html', destination: '', permanent: true }, destination: '/naming-services/overview',
{ source: '/core/naming/pickname.html', destination: '', permanent: true }, permanent: true,
{ source: '/core/naming/creationhowto.html', destination: '', permanent: true }, },
{ source: '/core/naming/resolving.html', destination: '', permanent: true }, {
{ source: '/core/naming/register.html', destination: '', permanent: true }, source: '/core/naming/architecture.html',
{ source: '/core/naming/manage.html', destination: '', permanent: true }, destination: '/naming-services/architecture',
{ source: '/core/naming/subdomains.html', destination: '', permanent: true }, permanent: true,
{ source: '/core/naming/forks.html', destination: '', permanent: true }, },
{ source: '/develop/collections.html', destination: '', permanent: true }, {
{ source: '/develop/collection-type.html', destination: '', permanent: true }, source: '/core/naming/namespaces.html',
{ source: '/storage/hub-operation.html', destination: '', permanent: true }, destination: '/naming-services/namespaces',
{ source: '/storage/amazon-s3-deploy.html', destination: '', permanent: true }, permanent: true,
{ source: '/storage/digital-ocean-deploy.html', destination: '', permanent: true }, },
{ source: '/storage/hello-hub-choice.html', destination: '', permanent: true }, {
{ source: '/storage/gaia-admin.html', destination: '', permanent: true }, source: '/core/naming/comparison.html',
{ source: '/core/atlas/overview.html', destination: '', permanent: true }, destination: '/naming-services/comparison',
{ source: '/core/atlas/howitworks.html', destination: '', permanent: true }, permanent: true,
{ source: '/core/atlas/howtouse.html', destination: '', permanent: true }, },
{ source: '/org/overview.html', destination: '', permanent: true }, {
{ source: '/faqs/allFAQS.html', destination: '', permanent: true }, source: '/core/naming/tutorial_subdomains.html',
{ source: '/org/token.html', destination: '', permanent: true }, destination: '/naming-services/subdomains-tutorial',
{ source: '/org/whitepaper-blockchain.html', destination: '', permanent: true }, permanent: true,
{ source: '/org/wallet-intro.html', destination: '', permanent: true }, },
{ source: '/org/wallet-install.html', destination: '', permanent: true }, {
{ source: '/org/wallet-use.html', destination: '', permanent: true }, source: '/core/naming/search.html',
{ source: '/org/wallet-troubleshoot.html', destination: '', permanent: true }, destination: '/naming-services/build-profile-search-index',
{ source: '/org/tokenholders.html', destination: '', permanent: true }, permanent: true,
{ source: '/core/cmdLineRef.html', destination: '', permanent: true }, },
{ source: '/core/smart/clarityRef.html', destination: '', permanent: true }, {
{ source: '/core/smart/rpc-api.html', destination: '', permanent: true }, source: '/core/faq_technical.html',
{ source: '/common/javascript_ref.html', destination: '', permanent: true }, destination: 'https://blockstack.zendesk.com/hc/en-us',
{ source: '/common/android_ref.html', destination: '', permanent: true }, permanent: true,
{ source: '/common/ios_ref.html', destination: '', permanent: true }, },
{ source: '/common/core_ref.html', destination: '', permanent: true }, {
{ source: '/core/wire-format.html', destination: '', permanent: true }, source: '/core/naming/pickname.html',
{ source: '/storage/config-schema.html', destination: '', permanent: true }, destination: '/naming-services/choose-name',
{ source: '/org/secureref.html', destination: '', permanent: true }, permanent: true,
{ source: '/develop/overview_auth.html', destination: '', permanent: true }, },
{ source: '/org/terms.html', destination: '', permanent: true }, {
source: '/core/naming/creationhowto.html',
destination: '/naming-services/create-namespace',
permanent: true,
},
{
source: '/core/naming/resolving.html',
destination: '/naming-services/resolve-name',
permanent: true,
},
{
source: '/core/naming/register.html',
destination: '/naming-services/register-name',
permanent: true,
},
{
source: '/core/naming/manage.html',
destination: '/naming-services/manage-names',
permanent: true,
},
{
source: '/core/naming/subdomains.html',
destination: '/naming-services/subdomains',
permanent: true,
},
{ source: '/core/naming/forks.html', destination: '/naming-services/forks', permanent: true },
{
source: '/develop/collections.html',
destination: '/data-storage/collections',
permanent: true,
},
{
source: '/develop/collection-type.html',
destination: '/data-storage/collections-type',
permanent: true,
},
{
source: '/storage/hub-operation.html',
destination: '/storage-hubs/overview',
permanent: true,
},
{
source: '/storage/amazon-s3-deploy.html',
destination: '/storage-hubs/amazon-s3-deploy',
permanent: true,
},
{
source: '/storage/digital-ocean-deploy.html',
destination: '/storage-hubs/digital-ocean-deploy',
permanent: true,
},
{
source: '/storage-hubs/hello-hub-choice.html',
destination: '/storage-hubs/hello-hub-choice',
permanent: true,
},
{
source: '/storage/gaia-admin.html',
destination: '/storage-hubs/gaia-admin',
permanent: true,
},
{
source: '/core/atlas/overview.html',
destination: '/stacks-blockchain/atlas/overview',
permanent: true,
},
{
source: '/core/atlas/howitworks.html',
destination: '/stacks-blockchain/atlas/how-atlas-works',
permanent: true,
},
{
source: '/core/atlas/howtouse.html',
destination: '/stacks-blockchain/atlas/usage',
permanent: true,
},
{ source: '/org/overview.html', destination: '/ecosystem/overview', permanent: true },
{
source: '/faqs/allFAQS.html',
destination: 'https://blockstack.zendesk.com/hc/en-us',
permanent: true,
},
{ source: '/org/token.html', destination: '/ecosystem/stacks-token', permanent: true },
{
source: '/org/whitepaper-blockchain.html',
destination: 'https://blockstack.org/whitepaper.pdf',
permanent: true,
},
{ source: '/org/wallet-intro.html', destination: '/stacks-wallet/overview', permanent: true },
{ source: '/org/wallet-install.html', destination: '/stacks-wallet/install', permanent: true },
{ source: '/org/wallet-use.html', destination: '/stacks-wallet/usage', permanent: true },
{
source: '/org/wallet-troubleshoot.html',
destination: '/stacks-wallet/troubleshooting',
permanent: true,
},
{
source: '/org/tokenholders.html',
destination: '/ecosystem/stacks-token-holders',
permanent: true,
},
{ source: '/core/cmdLineRef.html', destination: '/references/blockstack-cli', permanent: true },
{
source: '/core/smart/clarityRef.html',
destination: '/references/clarity-language',
permanent: true,
},
{
source: '/core/smart/rpc-api.html',
destination: '/references/stacks-rpc-api',
permanent: true,
},
{
source: '/common/javascript_ref.html',
destination: 'https://blockstack.github.io/blockstack.js/',
permanent: true,
},
{
source: '/common/android_ref.html',
destination: 'https://blockstack.github.io/blockstack-android/',
permanent: true,
},
{
source: '/common/ios_ref.html',
destination: 'https://blockstack.github.io/blockstack-ios/',
permanent: true,
},
{
source: '/common/core_ref.html',
destination: '/references/stacks-blockchain',
permanent: true,
},
{
source: '/core/wire-format.html',
destination: '/stacks-blockchain/wire-format',
permanent: true,
},
{
source: '/storage/config-schema.html',
destination: '/storage-hubs/config-schema',
permanent: true,
},
{ source: '/org/secureref.html', destination: '/stacks-wallet/security', permanent: true },
{
source: '/develop/overview_auth.html',
destination: '/authentication/overview',
permanent: true,
},
{ source: '/org/terms.html', destination: '/references/glossary', permanent: true },
]; ];
} }
@ -153,6 +301,7 @@ module.exports = withFonts(
jsconfigPaths: true, jsconfigPaths: true,
trailingSlash: true, trailingSlash: true,
}, },
redirects,
pageExtensions: ['js', 'ts', 'tsx', 'md', 'mdx'], pageExtensions: ['js', 'ts', 'tsx', 'md', 'mdx'],
webpack: (config, options) => { webpack: (config, options) => {
config.module.rules.push({ config.module.rules.push({

4
package.json

@ -6,8 +6,8 @@
"@docsearch/react": "^1.0.0-alpha.26", "@docsearch/react": "^1.0.0-alpha.26",
"@hashicorp/remark-plugins": "^3.0.0", "@hashicorp/remark-plugins": "^3.0.0",
"@mdx-js/loader": "1.6.15", "@mdx-js/loader": "1.6.15",
"@mdx-js/mdx": "^1.6.15", "@mdx-js/mdx": "^1.6.16",
"@mdx-js/react": "^1.6.15", "@mdx-js/react": "^1.6.16",
"@next/mdx": "^9.4.4", "@next/mdx": "^9.4.4",
"@reach/accordion": "^0.10.5", "@reach/accordion": "^0.10.5",
"@reach/tooltip": "^0.10.5", "@reach/tooltip": "^0.10.5",

83
src/components/custom-blocks/page-reference.tsx

@ -125,45 +125,66 @@ const InlineCard = ({ page }) => {
); );
}; };
const GridCard: React.FC<BoxProps & { page?: any }> = ({ page, ...rest }) => { const GridCardImage: React.FC<BoxProps & { isHovered?: boolean; page: any }> = React.memo(
const { hover, active, bind } = useTouchable({ ({ isHovered, page, ...props }) => (
behavior: 'link', <Box
}); bg="#9985FF"
return ( position="relative"
<Box position="relative" {...rest} {...bind}> borderRadius="12px"
<Box mb={space('loose')}
bg="#9985FF" overflow="hidden"
position="relative" {...props}
borderRadius="12px" >
mb={space('loose')} <Grid style={{ placeItems: 'center' }} height="0px" paddingTop="56.25%">
overflow="hidden" <Image
> width="102%"
<Grid style={{ placeItems: 'center' }} height="0px" paddingTop="56.25%"> size="102%"
<Image transition={transition('0.45s')}
width="102%" transform={isHovered && 'scale(1.08)'}
size="102%" style={{ willChange: 'transform' }}
transition={transition('0.45s')} src={page?.images?.large}
transform={(hover || active) && 'scale(1.08)'} position="absolute"
style={{ willChange: 'transform' }} left={'-2%'}
src={page?.images?.large} top={'-2%'}
position="absolute" />
left={'-2%'} </Grid>
top={'-2%'} </Box>
/> )
</Grid> );
</Box>
const GridCardDetails: React.FC<BoxProps & { isHovered?: boolean; page: any }> = React.memo(
({ isHovered, page, ...props }) => (
<>
<Flex alignItems="flex-start" justifyContent="flex-start" flexDirection="column"> <Flex alignItems="flex-start" justifyContent="flex-start" flexDirection="column">
<Title color={hover ? color('accent') : color('text-title')} mb={space('tight')}> <Title color="currentColor" mb={space('tight')}>
{page.title || page.headings[0]} {page.title || page.headings[0]}
</Title> </Title>
<Description>{page.description}</Description> <Description>{page.description}</Description>
</Flex> </Flex>
<FloatingLink href={`${page.path}`} /> <FloatingLink href={`${page.path}`} />
</>
)
);
const GridCard: React.FC<BoxProps & { page?: any }> = React.memo(({ page, ...rest }) => {
const { hover, active, bind } = useTouchable({
behavior: 'link',
});
return (
<Box
position="relative"
color={color('text-title')}
_hover={{ color: color('accent') }}
{...rest}
{...bind}
>
<GridCardImage page={page} isHovered={hover || active} />
<GridCardDetails page={page} />
</Box> </Box>
); );
}; });
export const PageReference = ({ children }) => { export const PageReference: React.FC<BoxProps> = React.memo(({ children }) => {
const content = onlyText(children).trim(); const content = onlyText(children).trim();
const [variant, _paths] = content.includes('\n') ? content.split('\n') : ['default', content]; const [variant, _paths] = content.includes('\n') ? content.split('\n') : ['default', content];
const paths = _paths.includes(', ') ? _paths.split(', ') : [_paths]; const paths = _paths.includes(', ') ? _paths.split(', ') : [_paths];
@ -188,4 +209,4 @@ export const PageReference = ({ children }) => {
)} )}
</Grid> </Grid>
); );
}; });

2
src/components/footer.tsx

@ -6,7 +6,7 @@ import { FeedbackSection } from '@components/feedback';
const Footer = ({ hidePagination, ...rest }: any) => { const Footer = ({ hidePagination, ...rest }: any) => {
return ( return (
<Section px={space(['extra-loose', 'extra-loose', 'none', 'none'])}> <Section px={space(['extra-loose', 'extra-loose', 'none', 'none'])} {...rest}>
<SectionWrapper> <SectionWrapper>
<Pagination /> <Pagination />
<FeedbackSection /> <FeedbackSection />

4
src/components/mdx/components/heading.tsx

@ -77,7 +77,7 @@ const Hashtag = () => (
export const Heading = ({ as, children, id, ...rest }: FlexProps) => { export const Heading = ({ as, children, id, ...rest }: FlexProps) => {
const { isActive, doChangeActiveSlug } = useActiveHeading(id); const { isActive, doChangeActiveSlug } = useActiveHeading(id);
const { bind, hover, active } = useTouchable({ const { bind: _bind, hover, active } = useTouchable({
behavior: 'link', behavior: 'link',
}); });
const router = useRouter(); const router = useRouter();
@ -90,6 +90,8 @@ export const Heading = ({ as, children, id, ...rest }: FlexProps) => {
}; };
const styles = getHeadingStyles(as as any); const styles = getHeadingStyles(as as any);
const bind = id ? _bind : {};
return ( return (
<Title <Title
as={as} as={as}

4
src/components/search.tsx

@ -46,7 +46,7 @@ const navigator = {
}, },
}; };
const Key: React.FC<BoxProps> = ({ children, ...rest }) => ( const Key: React.FC<BoxProps> = React.memo(({ children, ...rest }) => (
<Grid <Grid
style={{ style={{
placeItems: 'center', placeItems: 'center',
@ -70,7 +70,7 @@ const Key: React.FC<BoxProps> = ({ children, ...rest }) => (
{children} {children}
</Text> </Text>
</Grid> </Grid>
); ));
const searchOptions = { const searchOptions = {
apiKey: '9040ba6d60f5ecb36eafc26396288875', apiKey: '9040ba6d60f5ecb36eafc26396288875',

4
yarn.lock

@ -1469,7 +1469,7 @@
unist-builder "2.0.3" unist-builder "2.0.3"
unist-util-visit "2.0.3" unist-util-visit "2.0.3"
"@mdx-js/mdx@^1.6.15", "@mdx-js/mdx@^1.6.8": "@mdx-js/mdx@^1.6.16", "@mdx-js/mdx@^1.6.8":
version "1.6.16" version "1.6.16"
resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.6.16.tgz#f01af0140539c1ce043d246259d8becd2153b2bb" resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.6.16.tgz#f01af0140539c1ce043d246259d8becd2153b2bb"
integrity sha512-jnYyJ0aCafCIehn3GjYcibIapaLBgs3YkoenNQBPcPFyyuUty7B3B07OE+pMllhJ6YkWeP/R5Ax19x0nqTzgJw== integrity sha512-jnYyJ0aCafCIehn3GjYcibIapaLBgs3YkoenNQBPcPFyyuUty7B3B07OE+pMllhJ6YkWeP/R5Ax19x0nqTzgJw==
@ -1499,7 +1499,7 @@
resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.15.tgz#99a6061d0f74f2d01b95ad0314efba9ad6f19e81" resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.15.tgz#99a6061d0f74f2d01b95ad0314efba9ad6f19e81"
integrity sha512-C8yhsYZyFwL2kTa4Yw1zFIUxHcl225NrP75F6qgNbBum1APcsnl0WQ7N5V/l515gxnJmXSRQ6uL7pAFPZvdmzA== integrity sha512-C8yhsYZyFwL2kTa4Yw1zFIUxHcl225NrP75F6qgNbBum1APcsnl0WQ7N5V/l515gxnJmXSRQ6uL7pAFPZvdmzA==
"@mdx-js/react@^1.6.15", "@mdx-js/react@^1.6.8": "@mdx-js/react@^1.6.16", "@mdx-js/react@^1.6.8":
version "1.6.16" version "1.6.16"
resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.16.tgz#538eb14473194d0b3c54020cb230e426174315cd" resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.16.tgz#538eb14473194d0b3c54020cb230e426174315cd"
integrity sha512-+FhuSVOPo7+4fZaRwWuCSRUcZkJOkZu0rfAbBKvoCg1LWb1Td8Vzi0DTLORdSvgWNbU6+EL40HIgwTOs00x2Jw== integrity sha512-+FhuSVOPo7+4fZaRwWuCSRUcZkJOkZu0rfAbBKvoCg1LWb1Td8Vzi0DTLORdSvgWNbU6+EL40HIgwTOs00x2Jw==

Loading…
Cancel
Save