1
1
import PageNavbar from "@/components/PageNavbar" ;
2
+ import { blogsPageData } from "@/data" ;
2
3
import Image from "next/image" ;
3
- import Link from "next/link" ;
4
4
import React from "react" ;
5
5
import { twMerge } from "tailwind-merge" ;
6
+ import Author from "./components/Author" ;
7
+ import LeftSection from "./components/LeftSection" ;
8
+ import RightSection from "./components/RightSection" ;
6
9
7
10
export const dynamicParams = false ;
8
- type PagesDataType = {
9
- heroSection : {
10
- heading : string ;
11
- description : string ;
12
- images : {
13
- desktop : string ;
14
- mobile : string ;
15
- } ;
16
- date : string ;
17
- name : string ;
18
- } ;
19
- subHeadings : string [ ] ;
20
- latestPosts : {
21
- date : string ;
22
- name : string ;
23
- imgSrc : string ;
24
- title : string ;
25
- description : string ;
26
- link : string ;
27
- imgClassName : string ;
28
- } [ ] ;
29
- tags : {
30
- name : string ;
31
- link : string ;
32
- } [ ] ;
33
- author : {
34
- imgSrc : string ;
35
- name : string ;
36
- teamName : string ;
37
- } ;
38
- } ;
39
-
40
- const pagesData : { [ key : string ] : PagesDataType } = {
41
- "frontend-performance-testing-best-practices" : {
42
- heroSection : {
43
- heading : "Frontend Performance Testing: Best Practices" ,
44
- description :
45
- "Our complete suite of technology services to deliver better products, create stronger brands, new markets, and greater profitability through digital capabilities." ,
46
- images : {
47
- desktop :
48
- "https://procedure.tech/wp-content/uploads/2022/11/blog1-banner.webp" ,
49
- mobile :
50
- "https://procedure.tech/wp-content/uploads/2022/11/mob-blog1-banner.webp" ,
51
- } ,
52
- date : "November 30, 2022" ,
53
- name : "Rizwan Memon" ,
54
- } ,
55
- subHeadings : [
56
- "You have been working hard to deliver all the features on the project, and suddenly one fine day the company’s Slack goes off with messages like “Our bundle is around 17MB”or “Our website is lacking speed”. You are scratching your head as to why you even got here in the first place. What did you miss?" ,
57
- "This blog will walk you through some best practices for Frontend Performance and Testing. It will walk you through metrics you can calculate on your CI/CD pipelines to avoid those surprise attacks related to performance issues and React best practices for an optimized bundle." ,
58
- ] ,
59
- latestPosts : [
60
- {
61
- date : "May 26, 2022" ,
62
- name : "Rucheta Gogte" ,
63
- imgSrc :
64
- "https://i0.wp.com/procedure.tech/wp-content/uploads/2022/05/resources-blog3.webp?fit=800%2C800&ssl=1" ,
65
- title : "Why Robot Framework" ,
66
- description :
67
- "If you are trying to identify what are the best automation frameworks out there, we…" ,
68
- link : "https://procedure.tech/why-robot-framework/" ,
69
- imgClassName : "rounded-r-none rounded-bl-full rounded-br-full" ,
70
- } ,
71
- {
72
- date : "January 3, 2022" ,
73
- name : "Sreeraj Rajan" ,
74
- imgSrc :
75
- "https://i0.wp.com/procedure.tech/wp-content/uploads/2022/01/resources-blog4.webp?fit=800%2C800&ssl=1" ,
76
- title : "Reducing our Deployment times by 87%" ,
77
- description :
78
- "You can streamline your deployment process, decreasing deploy times significantly and enabling faster rollbacks with…" ,
79
- link : "https://procedure.tech/reducing-our-deployment-times-by-87/" ,
80
- imgClassName : "rounded-r-none rounded-tr-full rounded-tl-full" ,
81
- } ,
82
- {
83
- date : "June 10, 2021" ,
84
- name : "Sreeraj Rajan" ,
85
- imgSrc :
86
- "https://i0.wp.com/procedure.tech/wp-content/uploads/2021/06/resources-blog2.webp?fit=800%2C800&ssl=1" ,
87
- title : "Connecting Django to RDS via pgbouncer using IAM auth" ,
88
- description :
89
- "To connect Django to RDS via using IAM, you'll need an OIDC provider and a…" ,
90
- link : "https://procedure.tech/connecting-django-to-rds-via-pgbouncer-using-iam-auth/" ,
91
- imgClassName : "rounded-r-none rounded-bl-full rounded-tl-full" ,
92
- } ,
93
- ] ,
94
- tags : [
95
- {
96
- name : "Pipelines" ,
97
- link : "https://procedure.tech/tag/pipelines/" ,
98
- } ,
99
- {
100
- name : "react" ,
101
- link : "https://procedure.tech/tag/react/" ,
102
- } ,
103
- {
104
- name : "Slack" ,
105
- link : "https://procedure.tech/tag/slack/" ,
106
- } ,
107
- {
108
- name : "Frontend" ,
109
- link : "https://procedure.tech/tag/frontend/" ,
110
- } ,
111
- {
112
- name : "CI/CD" ,
113
- link : "https://procedure.tech/tag/ci-cd/" ,
114
- } ,
115
- ] ,
116
- author : {
117
- imgSrc : "https://procedure.tech/wp-content/uploads/2022/11/rizwan.jpg" ,
118
- name : "Rizwan Memon" ,
119
- teamName : "Tech@Procedure" ,
120
- } ,
121
- } ,
122
- } ;
123
11
124
12
export async function generateStaticParams ( ) {
125
- return Object . keys ( pagesData ) . map ( ( pageName ) => ( {
13
+ return Object . keys ( blogsPageData ) . map ( ( pageName ) => ( {
126
14
slug : pageName ,
127
15
} ) ) ;
128
16
}
@@ -133,7 +21,7 @@ export default async function Page({
133
21
params : Promise < { slug : string } > ;
134
22
} ) {
135
23
const slug = ( await params ) . slug ;
136
- const pageData = pagesData [ slug ] ;
24
+ const pageData = blogsPageData [ slug ] ;
137
25
138
26
return (
139
27
< >
@@ -181,68 +69,27 @@ export default async function Page({
181
69
< section className = "" >
182
70
< div className = "container-padding" >
183
71
< div className = "mt-[7vw] flex flex-wrap pb-7 lg:border-b lg:border-b-black/20" >
184
- < div className = "w-full mr-0 mb-12 lg:mb-0 lg:w-[65%] lg:mr-[5%]" >
185
- { pageData . subHeadings . map ( ( data , index ) => (
186
- < h2 key = { index } className = "text-xl lg:text-3xl mb-14" >
187
- { data }
188
- </ h2 >
189
- ) ) }
190
- </ div >
191
- < div className = "lg:w-[30%] mr-0 pt-5 border-none lg:border-t border-t-black/20" >
192
- < h4 className = "text-4xl mb-10 mt-5 text-[#505050] font-semibold" >
193
- Latest Posts
194
- </ h4 >
195
- < div className = "border-b border-b-black/20 pb-5 mb-10" >
196
- { pageData . latestPosts . map ( ( post , index ) => (
197
- < div key = { index } className = "mb-10" >
198
- < h6 className = "text-sm opacity-75 mb-1.5 font-normal" > { `${ post . date } | ${ post . name } ` } </ h6 >
199
- < h5 className = "text-xl mb-2.5 text-[#212529] font-medium" > { post . title } </ h5 >
200
- < p className = "text-sm mb-5 font-light" >
201
- { post . description }
202
- </ p >
203
- < Link
204
- className = "primary-button bg-white"
205
- href = { post . link }
206
- target = "_blank"
207
- >
208
- Read
209
- </ Link >
210
- </ div >
211
- ) ) }
212
- </ div >
213
- < h4 className = "text-4xl mb-10 mt-5 text-[#505050] font-semibold" >
214
- Tag Cloud
215
- </ h4 >
216
- < div className = "flex flex-wrap lg:border-b border-b-black/20 pb-10" >
217
- { pageData . tags . map ( ( tag ) => (
218
- < Link
219
- key = { tag . link }
220
- className = "py-1.5 px-5 bg-[#D0D0D0] mr-2.5 mb-2.5 rounded-full border-none text-sm relative animation-easein-slow left-0 hover:bg-[rgba(208,208,208,0.3)]"
221
- href = { tag . link }
222
- >
223
- { tag . name }
224
- </ Link >
225
- ) ) }
226
- </ div >
72
+ < LeftSection
73
+ subHeadings = { pageData . subHeadings }
74
+ content = { pageData . content }
75
+ />
76
+ < div className = "block lg:hidden ml-[calc(-7vw)] pt-5 pb-16 -mt-10 mx-auto cursor-default pointer-events-none" >
77
+ < Author
78
+ authorData = { pageData . author }
79
+ />
227
80
</ div >
81
+ < RightSection
82
+ latestPosts = { pageData . latestPosts }
83
+ tags = { pageData . tags }
84
+ />
228
85
</ div >
229
86
</ div >
230
87
</ section >
231
88
< div className = "hidden my-0 mx-auto py-16 px-0 cursor-default pointer-events-none lg:block" >
232
89
< div className = "container-padding" >
233
- < Link className = "relative left-0 flex items-center" href = "#" >
234
- < Image
235
- width = { 500 }
236
- height = { 500 }
237
- className = "w-20 h-20 rounded-full mr-5 max-w-full"
238
- src = { pageData . author . imgSrc }
239
- alt = { pageData . author . name }
240
- />
241
- < div className = "" >
242
- < h5 className = "text-xl font-semibold" > { pageData . author . name } </ h5 >
243
- < p className = "text-sm" > { pageData . author . teamName } </ p >
244
- </ div >
245
- </ Link >
90
+ < Author
91
+ authorData = { pageData . author }
92
+ />
246
93
</ div >
247
94
</ div >
248
95
</ >
0 commit comments