|
2 | 2 | import React from 'react'; |
3 | 3 | import { graphql } from 'gatsby'; |
4 | 4 | import Layout from '../components/layout'; |
5 | | -import LeftNav from "../components/LeftNav"; |
| 5 | +import LeftNav from '../components/LeftNav'; |
6 | 6 | import 'prismjs/themes/prism-tomorrow.css'; |
7 | 7 | import './page.scss'; |
8 | | -import SideBar from "../components/SideBar"; |
9 | | -import EditDoc from "../components/EditButton"; |
10 | | -import SEO from "../components/seo"; |
11 | | -import { Link } from "../../.cache/gatsby-browser-entry"; |
12 | | -import SearchInputBox from "../components/SearchInputBox"; |
13 | | -import MobileView from "../components/MobileView"; |
14 | | -import Footer from "../components/Footer" |
15 | | -import { environment } from "../environment"; |
| 8 | +import SideBar from '../components/SideBar'; |
| 9 | +import EditDoc from '../components/EditButton'; |
| 10 | +import SEO from '../components/seo'; |
| 11 | +import { Link } from '../../.cache/gatsby-browser-entry'; |
| 12 | +import SearchInputBox from '../components/SearchInputBox'; |
| 13 | +import MobileView from '../components/MobileView'; |
| 14 | +import Footer from '../components/Footer'; |
| 15 | +import { environment } from '../environment'; |
16 | 16 | import Header from '../components/header'; |
17 | 17 |
|
18 | 18 | export default ({ data, pageContext }) => { |
| 19 | + const prev = pageContext.prev |
| 20 | + ? { |
| 21 | + url: `${pageContext.prev.fields.slug}`, |
| 22 | + title: pageContext.prev.frontmatter.title, |
| 23 | + } |
| 24 | + : null; |
19 | 25 |
|
20 | | - const prev = pageContext.prev |
21 | | - ? { |
22 | | - url: `${pageContext.prev.fields.slug}`, |
23 | | - title: pageContext.prev.frontmatter.title |
24 | | - } |
25 | | - : null; |
26 | | - |
27 | | - const next = pageContext.next |
28 | | - ? { |
29 | | - url: `${pageContext.next.fields.slug}`, |
30 | | - title: pageContext.next.frontmatter.title |
31 | | - } |
32 | | - : null; |
33 | | - |
34 | | - const post = data.markdownRemark; |
35 | | - let contextualLinks; |
36 | | - if (post.frontmatter.contextual_links) { |
37 | | - contextualLinks = <SideBar links={post.frontmatter.contextual_links} />; |
38 | | - } |
39 | | - |
40 | | - if (environment.isStaging()) { |
41 | | - post.frontmatter.noindex = true; |
42 | | - } |
43 | | - |
44 | | - return ( |
45 | | - <Layout> |
46 | | - <SEO |
47 | | - title={post.frontmatter.page_title || post.frontmatter.title} |
48 | | - slug={post.fields.slug} |
49 | | - canonical={post.frontmatter.canonical} |
50 | | - metadesc={post.frontmatter.metadesc} |
51 | | - keywords={post.frontmatter.keywords} |
52 | | - social_share_summary={post.frontmatter.social_share_summary} |
53 | | - social_share_desc={post.frontmatter.social_share_desc} |
54 | | - social_share_image={post.frontmatter.social_share_image} |
55 | | - noindex={post.frontmatter.noindex} |
56 | | - /> |
57 | | - <Header/> |
58 | | - <hr /> |
59 | | - {/*<SubNav></SubNav>*/} |
60 | | - <div className="w-full"> |
61 | | - <div className="flex items-stretch"> |
62 | | - <MobileView></MobileView> |
63 | | - <nav className="w-1/4 max-w-sm bg-gray-50"> |
64 | | - <LeftNav /> |
65 | | - </nav> |
66 | | - <div className="flex-auto w-4/5"> |
67 | | - <div className="flex items-stretch w-full"> |
68 | | - <main className="w-4/5"> |
69 | | - <div className="doc-page px-20 py-14"> |
70 | | - <h1>{post.frontmatter.title}</h1> |
71 | | - <span dangerouslySetInnerHTML={{ __html: post.html }} /> |
72 | | - |
73 | | - </div> |
74 | | - |
75 | | - </main> |
76 | | - <aside className="w-1/5 bg-white"> |
77 | | - <hr className="d-block lg:hidden" /> |
78 | | - <div className="top-0 top-1 border-l pl-4 py-16 sticky"> |
79 | | - <div className="edit-button"> |
80 | | - <EditDoc className="items-end btn edit-button-styles flex inline-flex items-center" /> |
81 | | - </div> |
82 | | - {contextualLinks} |
83 | | - <div className='float-cta rounded'> |
84 | | - <h3 className='cta-title font-semibold'>See how you can release 10x faster.</h3> |
85 | | - <a href='/request-demo' target='_blank' className='signup-btn border border-green-600 px-4 py-1.5 bg-green-600 font-bold text-white rounded'>Book a free demo</a> |
86 | | - </div> |
87 | | - </div> |
88 | | - </aside> |
89 | | - </div> |
90 | | - <div className="pagination_buttons"> |
91 | | - <div className={prev ? 'flex justify-between' : 'overflow-hidden'}> |
92 | | - {prev && ( |
93 | | - <div className="prev_button"> |
94 | | - <Link to={prev.url}> |
95 | | - <span>Previous</span> |
96 | | - <svg stroke="" fill="#78757a" strokeWidth="0" |
97 | | - viewBox="0 0 24 24" className="css-1hyj6ne" height="1.6em" width="1.6em" |
98 | | - xmlns="http://www.w3.org/2000/svg"> |
99 | | - <path |
100 | | - d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"></path> |
101 | | - </svg> |
102 | | - <h3 className="perviousLink"> |
103 | | - {prev.title}</h3> |
104 | | - |
105 | | - </Link> |
106 | | - </div> |
107 | | - )} |
108 | | - {next && ( |
109 | | - <div className="next_button"> |
110 | | - <Link to={next.url}> |
111 | | - <span>Next</span> |
112 | | - <svg stroke="" fill="#78757a" strokeWidth="0" viewBox="0 0 24 24" |
113 | | - className="css-jmo9lw" height="1.6em" width="1.6em" |
114 | | - xmlns="http://www.w3.org/2000/svg"> |
115 | | - <path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"></path> |
116 | | - </svg> |
117 | | - <h3 className="next_link"> |
118 | | - {next.title} |
119 | | - </h3> |
120 | | - </Link> |
| 26 | + const next = pageContext.next |
| 27 | + ? { |
| 28 | + url: `${pageContext.next.fields.slug}`, |
| 29 | + title: pageContext.next.frontmatter.title, |
| 30 | + } |
| 31 | + : null; |
121 | 32 |
|
122 | | - </div> |
| 33 | + const post = data.markdownRemark; |
| 34 | + let contextualLinks; |
| 35 | + if (post.frontmatter.contextual_links) { |
| 36 | + contextualLinks = <SideBar links={post.frontmatter.contextual_links} />; |
| 37 | + } |
123 | 38 |
|
124 | | - )} |
125 | | - </div> |
126 | | - <Footer /> |
127 | | - </div> |
| 39 | + if (environment.isStaging()) { |
| 40 | + post.frontmatter.noindex = true; |
| 41 | + } |
128 | 42 |
|
129 | | - </div> |
| 43 | + return ( |
| 44 | + <Layout> |
| 45 | + <SEO |
| 46 | + title={post.frontmatter.page_title || post.frontmatter.title} |
| 47 | + slug={post.fields.slug} |
| 48 | + canonical={post.frontmatter.canonical} |
| 49 | + metadesc={post.frontmatter.metadesc} |
| 50 | + keywords={post.frontmatter.keywords} |
| 51 | + social_share_summary={post.frontmatter.social_share_summary} |
| 52 | + social_share_desc={post.frontmatter.social_share_desc} |
| 53 | + social_share_image={post.frontmatter.social_share_image} |
| 54 | + noindex={post.frontmatter.noindex} |
| 55 | + /> |
| 56 | + <Header /> |
| 57 | + <hr /> |
| 58 | + {/*<SubNav></SubNav>*/} |
| 59 | + <div className='w-full'> |
| 60 | + <div className='flex items-stretch'> |
| 61 | + <MobileView></MobileView> |
| 62 | + <nav className='w-1/4 max-w-sm bg-gray-50'> |
| 63 | + <LeftNav /> |
| 64 | + </nav> |
| 65 | + <div className='flex-auto w-4/5'> |
| 66 | + <div className='flex items-stretch w-full'> |
| 67 | + <main className='w-4/5'> |
| 68 | + <div className='doc-page px-20 py-14'> |
| 69 | + <h1>{post.frontmatter.title}</h1> |
| 70 | + <span dangerouslySetInnerHTML={{ __html: post.html }} /> |
| 71 | + </div> |
| 72 | + </main> |
| 73 | + <aside className='w-1/5 bg-white'> |
| 74 | + <hr className='d-block lg:hidden' /> |
| 75 | + <div className='top-0 top-1 border-l pl-4 py-16 sticky'> |
| 76 | + <div className='edit-button'> |
| 77 | + <EditDoc className='items-end btn edit-button-styles flex inline-flex items-center' /> |
| 78 | + </div> |
| 79 | + {contextualLinks} |
| 80 | + <div className='float-cta rounded'> |
| 81 | + <h3 className='cta-title font-semibold'> |
| 82 | + See how you can release 10x faster. |
| 83 | + </h3> |
| 84 | + <a |
| 85 | + href='/request-demo' |
| 86 | + target='_blank' |
| 87 | + className='signup-btn border border-primary_teal_green px-4 py-1.5 base-teal-gradient font-bold text-white rounded' |
| 88 | + > |
| 89 | + Book a free demo |
| 90 | + </a> |
| 91 | + </div> |
130 | 92 | </div> |
| 93 | + </aside> |
131 | 94 | </div> |
132 | | - </Layout> |
133 | | - ); |
| 95 | + <div className='pagination_buttons'> |
| 96 | + <div |
| 97 | + className={prev ? 'flex justify-between' : 'overflow-hidden'} |
| 98 | + > |
| 99 | + {prev && ( |
| 100 | + <div className='prev_button'> |
| 101 | + <Link to={prev.url}> |
| 102 | + <span>Previous</span> |
| 103 | + <svg |
| 104 | + stroke='' |
| 105 | + fill='#78757a' |
| 106 | + strokeWidth='0' |
| 107 | + viewBox='0 0 24 24' |
| 108 | + className='css-1hyj6ne' |
| 109 | + height='1.6em' |
| 110 | + width='1.6em' |
| 111 | + xmlns='http://www.w3.org/2000/svg' |
| 112 | + > |
| 113 | + <path d='M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z'></path> |
| 114 | + </svg> |
| 115 | + <h3 className='perviousLink'>{prev.title}</h3> |
| 116 | + </Link> |
| 117 | + </div> |
| 118 | + )} |
| 119 | + {next && ( |
| 120 | + <div className='next_button'> |
| 121 | + <Link to={next.url}> |
| 122 | + <span>Next</span> |
| 123 | + <svg |
| 124 | + stroke='' |
| 125 | + fill='#78757a' |
| 126 | + strokeWidth='0' |
| 127 | + viewBox='0 0 24 24' |
| 128 | + className='css-jmo9lw' |
| 129 | + height='1.6em' |
| 130 | + width='1.6em' |
| 131 | + xmlns='http://www.w3.org/2000/svg' |
| 132 | + > |
| 133 | + <path d='M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z'></path> |
| 134 | + </svg> |
| 135 | + <h3 className='next_link'>{next.title}</h3> |
| 136 | + </Link> |
| 137 | + </div> |
| 138 | + )} |
| 139 | + </div> |
| 140 | + <Footer /> |
| 141 | + </div> |
| 142 | + </div> |
| 143 | + </div> |
| 144 | + </div> |
| 145 | + </Layout> |
| 146 | + ); |
134 | 147 | }; |
135 | 148 |
|
136 | | - |
137 | 149 | export const query = graphql` |
138 | | - query($slug: String!) { |
| 150 | + query ($slug: String!) { |
139 | 151 | markdownRemark(fields: { slug: { eq: $slug } }) { |
140 | 152 | html |
141 | 153 | frontmatter { |
|
0 commit comments