Skip to content

Commit 8619c2e

Browse files
committed
fixes blogish
1 parent 68fc7dd commit 8619c2e

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

src/css/blog.scss

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
background-color: white;
1414
}
1515

16-
[itemprop="blogPost"] {
16+
.blog-wrapper {
1717
header {
1818
display: none;
1919
}
@@ -23,15 +23,17 @@
2323
// color: white !important;
2424
// }
2525

26-
[itemprop="articleBody"] {
27-
display: flex;
28-
flex-direction: column;
29-
li {
30-
margin-bottom: 1rem;
31-
}
32-
}
26+
3327
.blog-post-page {
3428

29+
#__blog-post-container {
30+
display: flex;
31+
flex-direction: column;
32+
li {
33+
margin-bottom: 1rem;
34+
}
35+
}
36+
3537
@include conditional-styles("col--2");
3638
.row {
3739
justify-content: flex-start !important;
@@ -50,19 +52,22 @@
5052

5153

5254

53-
// li {
54-
// list-style: auto !important;
55-
// }
55+
li {
56+
list-style: auto !important;
57+
}
5658

5759
.table-of-contents {
5860
display: none;
5961
}
6062

61-
p {
62-
font-size: 18px;
63+
.dev-docs-blog {
64+
p {
65+
font-size: 18px;
66+
}
6367
}
6468

6569

70+
6671
.blog-header-title-card {
6772
line-break: strict;
6873
white-space: normal; // or pre-wrap to preserve white spaces
@@ -145,6 +150,8 @@
145150
min-width: 100vw !important;
146151
}
147152

153+
154+
148155
.blog-header-title-card {
149156
line-break: strict;
150157
height: 40vh !important;
@@ -179,7 +186,7 @@
179186
}
180187
}
181188

182-
[itemtype="http://schema.org/BlogPosting"]
189+
article
183190
{
184191
margin-bottom: 2em !important;
185192
padding-bottom: 0px !important;
@@ -211,10 +218,9 @@
211218
}
212219
}
213220

214-
> *:not(.blog-header-title-card) {
221+
.dev-docs-blog {
215222
display: none;
216-
// styles for all children except the one with the class "exclude-child"
217223
}
218224
}
219225
}
220-
}
226+
}

src/theme/MDXContent/index.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import MDXContent from "@theme-original/MDXContent";
44
import TracingBeam from "@site/src/components/tracing-beam";
55
import svgToDataUri from "mini-svg-data-uri";
66
import { BackgroundGradientAnimation } from "@site/src/components/background-gradient-animation";
7-
import { useHistory } from "@docusaurus/router";
7+
88

99
export default function MDXContentWrapper(props) {
1010
let image = `url("${svgToDataUri(
@@ -17,9 +17,11 @@ export default function MDXContentWrapper(props) {
1717
history.push("/docs/another-page");
1818
};
1919

20+
console.log("bloggging", props?.children?.type?.metadata)
21+
2022
return (
2123
<>
22-
{props?.children?.type?.metadata?.title ? (
24+
{props?.children?.type?.metadata?.source.includes("@site/blog") ? (
2325
<>
2426
<BackgroundGradientAnimation
2527
lightImage={props?.children?.type?.frontMatter?.light_image}
@@ -43,13 +45,13 @@ export default function MDXContentWrapper(props) {
4345
>
4446
<h1 style={{ color: props?.children?.type?.frontMatter?.text_color}}>
4547
<a style={{ color: props?.children?.type?.frontMatter?.text_color}} href={props.children.type.metadata.permalink}>
46-
{props.children.type.metadata.title}
48+
{props.children.type.metadata.title || "yo"}
4749
</a>
4850
</h1>
4951
<h3
5052
style={{ paddingLeft: "1vw", fontSize: "16px", fontWeight: 400, color: props?.children?.type?.frontMatter?.text_color }}
5153
>
52-
{props.children.type.metadata.authors.length > 0 &&
54+
{props?.children?.type?.metadata?.authors?.length > 0 &&
5355
props.children.type.metadata.authors.map((item, index) => (
5456
<span style={{color: props?.children?.type?.frontMatter?.text_color}} key={index}>{" " + item.name + ","}</span>
5557
))}
@@ -58,7 +60,7 @@ export default function MDXContentWrapper(props) {
5860
<span style={{color: props?.children?.type?.frontMatter?.text_color}}>{Math.ceil(props.children.type.metadata.readingTime * 10) / 1} min</span>
5961
</h3>
6062
<div className="flex flex-row items-center mb-10 w-full">
61-
{props.children.type.metadata.authors.map((item, index) => (
63+
{props?.children?.type?.metadata.authors?.map((item, index) => (
6264
<div className="pl-2">
6365
<img
6466
className="author-avatar"
@@ -68,7 +70,7 @@ export default function MDXContentWrapper(props) {
6870
</div>
6971
))}
7072
<div className="pl-6">
71-
{props.children.type.metadata.authors.length > 0 &&
73+
{props?.children?.type?.metadata?.authors?.length > 0 &&
7274
props.children.type.metadata.authors.map((item, index) => (
7375
<span style={{color: props?.children?.type?.frontMatter?.text_color}} key={index}>
7476
{" " + item.name + (index < props.children.type.metadata.authors.length - 1 ? "," : "")}
@@ -77,15 +79,17 @@ export default function MDXContentWrapper(props) {
7779
</div>
7880
</div>
7981
</BackgroundGradientAnimation>
80-
<MDXContent style={{ backgroundImage: image }} {...props} />
82+
<div className="dev-docs-blog">
83+
<MDXContent style={{ backgroundImage: image }} {...props} />
84+
</div>
8185
</>
8286
) : (
8387
<TracingBeam>
84-
<div>
88+
<div id="tracing-beam">
8589
<MDXContent style={{ backgroundImage: image }} {...props} />
8690
</div>
8791
</TracingBeam>
8892
)}
8993
</>
9094
);
91-
}
95+
}

0 commit comments

Comments
 (0)