Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix relative links and adapt to base path in production (#594)

* Fix relative links and adapt to base path in production

* Add prod:serve task to packages/site

* Fix header path

authored by

Phil Plückthun and committed by
GitHub
9d9b90f3 b7a36c0b

+19 -6
+1
packages/site/dist-prod/open-source/urql
··· 1 + ../../dist
+2 -1
packages/site/package.json
··· 12 12 "stage:build": "react-static build --staging", 13 13 "stage:deploy": "node scripts/deploy/surge.js", 14 14 "prod:build": "react-static build", 15 - "prod:deploy": "node scripts/deploy/aws.js" 15 + "prod:deploy": "node scripts/deploy/aws.js", 16 + "prod:serve": "serve -l 3000" 16 17 }, 17 18 "babel": { 18 19 "presets": [
+4
packages/site/serve.json
··· 1 + { 2 + "public": "dist-prod", 3 + "trailingSlash": true 4 + }
+5 -1
packages/site/src/components/sidebar.js
··· 48 48 }; 49 49 50 50 const Sidebar = ({ sidebarOpen }) => { 51 - const { pathname } = useLocation(); 51 + const location = useLocation(); 52 52 const currentPage = useMarkdownPage(); 53 53 const tree = useMarkdownTree(); 54 + 55 + const pathname = location.pathname.endsWith('/') 56 + ? currentPage.path + '/' 57 + : currentPage.path; 54 58 55 59 const sidebarItems = useMemo(() => { 56 60 if (!currentPage || !tree || !tree.children) {
+4 -1
packages/site/src/screens/docs/header.js
··· 1 1 import React from 'react'; 2 2 import styled from 'styled-components'; 3 3 import { Link } from 'react-router-dom'; 4 + import { useBasepath } from 'react-static'; 4 5 5 6 import formidableLogo from '../../assets/logos/logo-formidable.svg'; 6 7 ··· 53 54 `; 54 55 55 56 const Header = () => { 57 + const basepath = useBasepath() || ''; 58 + 56 59 return ( 57 60 <Fixed> 58 61 <Wrapper> 59 62 <BlockLink href="https://formidable.com/"> 60 63 <FormidableLogo /> 61 64 </BlockLink> 62 - <ProjectWording to="/">urql</ProjectWording> 65 + <ProjectWording to={`/${basepath}/`}>urql</ProjectWording> 63 66 </Wrapper> 64 67 </Fixed> 65 68 );
+1 -1
packages/site/src/screens/home/get-started.js
··· 118 118 <img src={octoCat} /> 119 119 <p>GitHub</p> 120 120 </GithubButton> 121 - <DocButton to="/docs">Documentation</DocButton> 121 + <DocButton to="docs/">Documentation</DocButton> 122 122 </ButtonsWrapper> 123 123 </GetStartedWrapper> 124 124 </OuterWrapper>
+2 -2
packages/site/src/screens/home/hero.js
··· 252 252 <HeroNPMCopy>npm install urql</HeroNPMCopy> 253 253 <HeroNPMButton onClick={this.handleCopy}>copy</HeroNPMButton> 254 254 </HeroNPMWrapper> 255 - <HeroDocsButton to="/docs">Documentation</HeroDocsButton> 255 + <HeroDocsButton to="docs/">Documentation</HeroDocsButton> 256 256 </HeroButtonsWrapper> 257 257 </HeroContent> 258 258 <HeroNavList> 259 259 <li> 260 - <Link to="/docs">Docs</Link> 260 + <Link to="docs/">Docs</Link> 261 261 </li> 262 262 <li> 263 263 <a