Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit 8826707

Browse files
authored
Make the preview images look nicer (#61)
* save * giving up on book icon background for now
1 parent 212659d commit 8826707

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/renderer/image-renderers.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ const titleElement = ({ children }) =>
2525
const waveLogoElement = React.createElement("img", {
2626
src: waveLogoBase64,
2727
style: {
28-
position: "absolute",
29-
top: 20,
30-
right: 20,
3128
width: 300,
3229
},
3330
});
@@ -39,20 +36,18 @@ const headerElement = (header: string, svg: ReactNode) =>
3936
style: {
4037
display: "flex",
4138
alignItems: "center",
42-
position: "absolute",
43-
top: 20,
44-
left: 40,
39+
marginTop: "50px",
4540
},
4641
},
4742
svg,
4843
React.createElement(
4944
"label",
5045
{
5146
style: {
52-
fontSize: 50,
47+
fontSize: 30,
5348
fontWeight: 600,
5449
letterSpacing: 1,
55-
color: "#e3e3e3",
50+
color: "#58c142",
5651
},
5752
},
5853
header
@@ -64,24 +59,25 @@ const rootDivStyle: React.CSSProperties = {
6459
flexDirection: "column",
6560
height: "100%",
6661
width: "100%",
67-
padding: "10px 40px",
62+
padding: "50px 50px",
6863
justifyContent: "center",
6964
fontFamily: "Roboto",
7065
fontSize: 32,
7166
fontWeight: 400,
7267
backgroundColor: "#1b1b1d",
7368
color: "#e3e3e3",
7469
borderBottom: "2rem solid #58c142",
70+
zIndex: "2 !important",
7571
};
7672

7773
export const docOgRenderer: ImageRenderer<DocsPageData> = async (data, context) => {
7874
const element = React.createElement(
7975
"div",
8076
{ style: rootDivStyle },
81-
React.createElement(titleElement, null, data.metadata.title),
82-
React.createElement("div", null, data.metadata.description.replace("&mdash;", "-")),
8377
waveLogoElement,
84-
headerElement(context.siteConfig.title, null)
78+
headerElement("Documentation", null),
79+
React.createElement(titleElement, null, data.metadata.title),
80+
React.createElement("div", null, data.metadata.description.replace("&mdash;", "-"))
8581
);
8682

8783
return [element, await imageGeneratorOptions()];

0 commit comments

Comments
 (0)