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