-
Notifications
You must be signed in to change notification settings - Fork 1
/
{mdx.slug}.tsx
394 lines (385 loc) · 16.3 KB
/
{mdx.slug}.tsx
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
import * as React from 'react'
import { useRef, forwardRef } from 'react'
import type { HeadProps } from 'gatsby'
import { graphql, Link, PageProps, FC } from 'gatsby'
import { MDXRenderer } from 'gatsby-plugin-mdx'
import Layout from '@/components/Layout'
import PageTransition from '@/components/PageTransition'
import { CalendarIcon, ClockIcon, TagIcon } from '@heroicons/react/24/outline'
import NowPlaying from '@/components/PlayList'
import SeoBlog from '@/components/Seo/SeoBlog'
import ImageColWrapperPage from '@/components/ImageColWrapper'
import { SuspenseHelper } from '@/components/SuspenseHelper'
const Bio = React.lazy(() => import('@/components/Bio'))
const Tags = React.lazy(() => import('@/components/SiteTags'))
const GiscusComments = React.lazy(() => import('@/components/GiscusComments'))
const WavyHr = React.lazy(() => import('@/components/WavyHr'))
interface ImageProp {
image: GatsbyImageData
full: IGatsbyImageData
thumb: IGatsbyImageData
imgClass?: string
thumbAlt?: string
title?: string
caption?: string
customWrapper?: FC
}
type DataProps = {
data: {
mdx: {
frontmatter: {
title: string
description: string
author: string
path: string
date: string
embeddedImagesLocal: ImageProp[]
tags: string[]
publicId: string
videoTitle: string
}
slug: string
excerpt: string
parent: {
modifiedTime: string
}
body: string
tableOfContents: JSON
pathname: string
timeToRead: string
}
}
}
interface PageProps {
data: {
mdx: {
frontmatter: {
title: string
description: string
path: string
author: string
date: string
embeddedImagesLocal: ImageProp[]
tags: string[]
publicId: string
videoTitle: string
}
slug: string
excerpt: string
parent: {
modifiedTime: string
}
body: string
tableOfContents: JSON
pathname: string
timeToRead: string
}
}
}
type BlogPostRef = React.ForwardedRef<HTMLDivElement>
function BlogPost({ data }: PageProps<DataProps>, ref: BlogPostRef) {
const { frontmatter, timeToRead, id, customWrapper = ImageColWrapperPage, imgClass = '' } = data.mdx
const pathname = '/' + data.mdx.slug
return (
<>
<Layout>
<PageTransition ref={ref}>
<div className="left-beams -mt-10 object-cover">
<div className="mb-20 mt-10 font-inter">
<section className="prose-text:text-slate-900 prose-text:dark:text-slate-200 prose mx-auto mb-10 mt-2 max-w-screen-lg px-4 md:prose-lg lg:prose-xl prose-a:text-purple-600 hover:prose-a:text-purple-500 lg:px-0">
<div className="mt-4 py-4">
<h1 className="mb-2 text-lg font-semibold leading-normal">{frontmatter.title}</h1>
<div className="flex items-center">
<span className="ml-2 text-slate-900 first-letter:float-left first-letter:mr-3 first-letter:font-garamond first-letter:text-7xl first-letter:font-bold first-letter:uppercase first-letter:text-slate-900 first-line:tracking-widest dark:text-slate-200 dark:first-letter:text-slate-300">
{frontmatter.description}
</span>
</div>
</div>
<div className="mb-4 ml-2 text-slate-900 dark:text-slate-200">
<SuspenseHelper fallback={<div>Loading...</div>}>
<Bio />
</SuspenseHelper>
</div>
<div>
<div className="mb-10 flex flex-wrap items-center sm:place-content-center md:place-content-center lg:place-content-start">
<div className="ml-3 mr-2 inline-flex items-center py-1 text-base leading-none text-slate-900 dark:text-slate-200">
<TagIcon className="mr-2 h-6 w-6" />
<SuspenseHelper fallback={<div>Loading...</div>}>
<Tags className="px-2 py-1" tags={frontmatter.tags} />
</SuspenseHelper>
</div>
<div className="mr-2 inline-flex items-center py-1 text-base leading-none text-slate-900 dark:text-slate-200">
<CalendarIcon className="mr-1 h-6 w-6" />
{frontmatter.date}
</div>
<div className="mr-3 inline-flex items-center text-base leading-none text-slate-900 dark:text-slate-200">
<ClockIcon className="mr-1 h-6 w-6" />
{timeToRead} min read
</div>
<div className="mr-3 inline-flex items-center text-base leading-none">
<NowPlaying />
</div>
</div>
</div>
<MDXRenderer localImages={frontmatter.embeddedImagesLocal}>{data.mdx.body}</MDXRenderer>
<SuspenseHelper fallback={<div>Loading...</div>}>
<GiscusComments mapping={pathname} />
</SuspenseHelper>
<SuspenseHelper fallback={<div>Loading...</div>}>
<WavyHr />
</SuspenseHelper>
</section>
</div>
</div>
</PageTransition>
</Layout>
</>
)
}
export default forwardRef(BlogPost)
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
export function Head(props: HeadProps<DataProps>) {
const siteUrl = 'https://publiuslogic.com'
const pathname = '/' + props.data.mdx.slug
const excerpt = props.data.mdx.excerpt
const seo = {
path: `${siteUrl}${pathname || ''}`,
}
const Image = props.data.mdx.frontmatter.embeddedImagesLocal[0]
return (
<>
<SeoBlog
type="page"
title={props.data.mdx.frontmatter.title}
description={props.data.mdx.frontmatter.description}
image={Image}
pathname={seo.path}
>
<title>{props.data.mdx.frontmatter.title}</title>
<meta name="description" content={props.data.mdx.frontmatter.description} />
<meta name="image" content={Image} />
<meta name="twitter:site" content="@donaldboulton" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={props.data.mdx.frontmatter.title} />
<meta name="twitter:url" content={seo.path} />
<meta name="twitter:description" content={props.data.mdx.frontmatter.description} />
<meta name="twitter:image" content={Image} />
<meta name="twitter:creator" content="@donboulton" />
<meta name="og:title" content={props.data.mdx.frontmatter.title} />
<meta name="og:url" content={seo.path} />
<meta name="og:description" content={props.data.mdx.frontmatter.description} />
<meta name="og:site_name" content="PubliusLogic" />
<meta name="og:image" content={Image} />
<meta name="og:image:title" content={props.data.mdx.frontmatter.title} />
<meta name="og:image:alt" content={props.data.mdx.frontmatter.title} />
<meta name="og:image:width" content="1400px" />
<meta name="og:image:height" content="450px" />
<meta name="og:updated_time" content={props.data.mdx.parent.modifiedTime} />
<meta name="canonical" content={seo.path} />
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml" />
</SeoBlog>
<script type="application/ld+json">
{JSON.stringify({
'@context': 'https://schema.org',
'@type': 'WebSite',
about: {
'@id': 'https://publiuslogic.com',
},
audience: 'public',
abstract:
'PubliusLogic has Topics on Creation, Law, USA and World Governments, Life Matters. Our Main focus is the Re-Creation of Mankind to the Spiritual Beings you have forgotten about, as you only live in the Flesh. Your Soul and Spirit you deny.',
author: {
'@id': 'https://donwboulton.com',
},
copyrightHolder: {
'@id': 'https://publiuslogic.com',
},
copyrightYear: 2023,
creator: {
'@id': 'https://publiuslogic.com',
},
description: 'PubliusLogic name means to Publish Logic',
image: {
'@type': 'ImageObject',
url: Image,
width: '1400px',
height: '450px',
},
inLanguage: 'en',
name: 'PubliusLogic',
publisher: {
'@id': 'https://publiuslogic.com',
},
url: 'https://publiuslogic.com',
})}
</script>
<script type="application/ld+json">
{JSON.stringify({
'@context': 'https://schema.org',
'@type': 'WebPage',
name: props.data.mdx.frontmatter.title,
url: seo.path,
image: {
'@type': 'ImageObject',
url: Image,
width: '1400',
height: '450',
},
publisher: {
'@type': 'Organization',
name: 'Mansbooks.com',
},
license: 'http://publiuslogic.com/blog/0bsd-licence',
})}
</script>
<script type="application/ld+json">
{JSON.stringify({
'@context': 'https://schema.org',
'@type': 'BlogPosting',
headline: props.data.mdx.frontmatter.title,
alternativeHeadline: props.data.mdx.frontmatter.description,
mainEntityOfPage: seo.path,
image: Image,
award: 'Best Blog page ever built',
editor: props.data.mdx.frontmatter.author,
genre: 'group',
keywords: props.data.mdx.frontmatter.tags,
wordCount: '1120',
publisher: 'PubliusLogic',
url: seo.path,
datePublished: props.data.mdx.frontmatter.date,
dateCreated: props.data.mdx.frontmatter.date,
dateModified: props.data.mdx.parent.modifiedTime,
description: props.data.mdx.frontmatter.description,
articleBody: excerpt,
author: {
'@type': 'Person',
name: props.data.mdx.frontmatter.author,
},
})}
</script>
<script type="application/ld+json">
{JSON.stringify({
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
description: 'Breadcrumbs list',
itemListElement: [
{
'@type': 'ListItem',
item: {
'@id': 'https://publiuslogic.com/',
name: 'PubliusLogic Blog',
},
position: '1',
},
{
'@type': 'ListItem',
item: {
'@id': 'https://publiuslogic.com/blog',
name: 'PubliusLogic Blog',
},
position: '2',
},
{
'@type': 'ListItem',
item: {
'@id': seo.path,
name: props.data.mdx.frontmatter.title,
},
position: '3',
},
],
numberOfItems: '3',
name: 'Breadcrumbs',
})}
</script>
<script type="application/ld+json">
{JSON.stringify({
'@context': 'https://schema.org',
'@id': 'https://publiuslogic.com',
'@type': 'Organization',
address: 'OKC, Middle Earth',
contactPoint: {
'@type': 'ContactPoint',
email: 'donboulton@donboulton.com',
telephone: '+405-863-2165',
},
description:
'PubliusLogic has Topics on Creation, Law, USA and World Governments, Life Matters. Our Main focus is the Re-Creation of Mankind to the Spiritual Beings you have forgotten about, as you only live in the Flesh. Your Soul and Spirit you deny.',
email: 'donboulton@donboulton.com',
founder: {
'@id': 'https://donwboulton.com',
},
location: 'OKC, Middle Earth',
image: {
'@type': 'ImageObject',
url: 'https://publiuslogic.com/static/images/jpg/dbbg.jpg',
width: '1400',
height: '450',
},
logo: {
'@type': 'ImageObject',
url: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALYAAAAgCAMAAACIEXJoAAABcVBMVEUAAABhXVygoKCfoKGgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCbnJygoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKADp/H8vwf7vgcFpOygoKAInuLWfyPxQzbtQzj8vgYEp/ADp+/4vAjxtwriWS/ghSDxQzYEp/DxQzUGougEpvD6vQj5vQjtQzbpQjbxQjbwQzYFpu3vQzbuQzb5vQjtQzbxkRvlQjb6lgnyTTBEccXJuCugoKDyQzb9vwYDp/H9lgFmOrVMrU8BAAETluf0WicKqOJArGrEQF9JpUzCuR/8sQVUT8Ahqa0PGhNBJgI8ac5xO6s5H2VJrVPYQUx7sj4XMBfVbhTivRL8nwLujwFXMpqNPJGOOoQ1q4MqXlsqGVBbrkqKszcyUCH3dhXVphCYWwKg0J9kAAAAUHRSTlMABOMTPCH31vQNN3sIp5smgBp0HpPcrIVsU+pMykXRjKLvw7JmX1m9tzH29MZKLB8N+Znh3HpYKx0U1sqvM6qbf1wx6sWShnFtVUEo8t/acxJP1RYAAAXiSURBVFjD1dgHk5pAGAbgZUGKIgjKCYhiL8ldzvTee/9SLr333vuvzy67AhqPyUxmcsl7MzqLy/KwfCyeCAlRyPt455i+TQf9q2G6ndv2Ly4u7t+2g7cF9D+wty2uvxhlcZv+/8z2CYLmWX9gHHHZ37/MRtuYmrtP/B+zjbZvvpjO5u1k6yxb1NC/FQEduDid/TsOnd6hozRbr0tm2SIR586/7hZMlI5XksirZJsoM6JtWyg7er8rzmWPF6fVd8+cPXx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CvEyptuo0wGrQLgcbZPcAb2EHIHFB1e0NuZDIdZ4982WPjVxR3dra5m7M3btopxGwUptm02BrUaQ6As2FI25qtyj00xUYGBDnatQ206cmtfnR46AiMTbWdHFUb4JhECIFdy5uWkGILBnuOCb1WS4prO+1+dC+q7Y27jo+F1dl5DI1St6ooQ8aWO6oTuoWhDBV9hi2RroVu1WkMaFNrgm90u01V7cd1LzmgVLulAPw+lWEAkFtOp5/UNioPAFe6brEll5hJ0OlKkoaf27Rnz6aDO6b/l6xCBaVTawBJWypQoBhgycVA4hQ0tr4UKJ5VkqcAySBfjZpiyDq6AjE5PmWjfEel1HYtGtnHYdgcKiAXqFfxKRuVKz6QKK6OknV7KluRrv/yO0lOMtFULM+2ayKypDIZY5TXUa5fsPs5vnpLZf5KU2Zdy6wpbOhNOup5iZWwJrkFty5G4zZUj/aySoBN3iXezSsn67Y4Pd27lwWWtfm9oQaBliylq4bo9u5OqbcspX6YWgO3Bw0xvhkz2NPu3UvcvFazvQFDaNHJNqAtZrIFtLx1Cy3wdVuOLpMNazrbyFZBKRpFBXAdZbBZlpe2bt26tBxZ17S2keAtYFVWcTOfqeZhjYygvxY9J9WlnIBWJ/0ENXFZucWinZQAAAAASUVORK5CYII=',
},
name: 'PubliusLogic',
sameAs: [
'mailto:donboulton@donboulton.com',
'tel:+405-863-2165',
'https://www.facebook.com/donboulton',
'https://www.instagram.com/boulton3662',
'https://twitter.com/donboulton',
'https://www.linkedin.com/donboulton',
'https://github.com/donaldboulton/',
],
url: 'https://publiuslogic.com',
})}
</script>
<script type="application/ld+json">
{JSON.stringify({
'@context': 'https://schema.org',
'@type': 'Person',
'@id': 'https://donwboulton.com',
name: 'Donald Boulton',
url: 'https://donwboulton.com',
worksFor: {
'@id': 'https://publiuslogic.com',
},
})}
</script>
</>
)
}
export const query = graphql`
query ($id: String) {
mdx(id: { eq: $id }) {
frontmatter {
title
description
author
path
publicId
embeddedImagesLocal {
childImageSharp {
gatsbyImageData
}
}
date(formatString: "YYYY-MM-DD")
tags
}
headings {
value
depth
}
slug
id
excerpt(pruneLength: 5000)
timeToRead
parent {
... on File {
modifiedTime
}
}
body
}
}
`