Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup branch #1085

Merged
merged 4 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 4 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,57 +201,10 @@ As part of the Next.js middlewares setup, a [matcher config](src/middleware.ts)

### OpenGraph image customization

As part of providing the basic metadata for the [OpenGraph Protocol](https://ogp.me), a fallback image is generated if no other is specified. Fonts and background can be customized as shown below.
As part of providing the basic metadata for the [OpenGraph Protocol](https://ogp.me), a fallback image is generated if no other is specified.

#### Custom fonts

The following font utils file can be defined:

> fonts must be placed in `/public/fonts`

```tsx
import { readFile } from "fs/promises";
import { join } from "path";

type Weight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
type FontStyle = "normal" | "italic";
interface FontOptions {
data: Buffer | ArrayBuffer;
name: string;
weight?: Weight;
style?: FontStyle;
lang?: string;
}

function readFont(filename: string) {
return readFile(join(process.cwd(), "public/fonts", filename));
}

export async function getFonts(): Promise<FontOptions[]> {
return [
{
data: await readFont("graphik_regular.woff"),
name: "Graphik",
weight: 400,
style: "normal",
},
{
data: await readFont("graphik_medium.woff"),
name: "Graphik",
weight: 600,
style: "normal",
},
{
data: await readFont("recoleta.ttf"),
name: "Recoleta",
weight: 600,
style: "normal",
},
];
}
```

followed by a modification of the image route response:
````
a modification of the image route response:

```tsx
(<OpenGraphImage title={title} description={description ?? undefined} />),
Expand All @@ -260,7 +213,7 @@ followed by a modification of the image route response:
height: 630,
fonts: await getFonts(), // add this line
};
```
````

#### Custom background

Expand Down
8 changes: 0 additions & 8 deletions public/_assets/arrow-back.svg

This file was deleted.

4 changes: 0 additions & 4 deletions public/_assets/arrowLeft.svg

This file was deleted.

4 changes: 0 additions & 4 deletions public/_assets/arrowRight.svg

This file was deleted.

14 changes: 0 additions & 14 deletions public/_assets/check-circle.svg

This file was deleted.

Binary file removed public/_assets/recoleta.otf
Binary file not shown.
Binary file removed public/_assets/sharedStudioIcon.png
Binary file not shown.
7 changes: 7 additions & 0 deletions public/_assets/shook-square-figure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions public/_assets/smile-square-figure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/_assets/studioIcon.png
Binary file not shown.
4 changes: 2 additions & 2 deletions studio/components/studioIcon/StudioIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const StudioIcon = ({ variant }: { variant: "studio" | "shared" }) => {
className={styles.icon}
src={
variant === "studio"
? "/_assets/studioIcon.png"
: "/_assets/sharedStudioIcon.png"
? "/_assets/smile-square-figure.svg"
: "/_assets/shook-square-figure.svg"
}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion studio/studioConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const SUPPORTED_LANGUAGES_QUERY = `*[_type == "languageSettings" && !(_id in pat
const config: WorkspaceOptions = {
name: "studio",
title: "Studio",
subtitle: "Variant Norge",
subtitle: `Website content`,
icon: () => <StudioIcon variant="studio" />,
basePath: "/studio",
projectId,
Expand Down
2 changes: 1 addition & 1 deletion studioShared/studioConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { schema } from "./schema";
const config: WorkspaceOptions = {
name: "sharedStudio",
title: "Shared Studio",
subtitle: "Sharing is Caring!",
subtitle: "Customer cases and other shared content",
icon: () => <StudioIcon variant="shared" />,
basePath: "/shared",
projectId,
Expand Down
Loading