Skip to content

Commit 2056be3

Browse files
committed
Update title
1 parent 55d07e0 commit 2056be3

14 files changed

+55
-30
lines changed

components/Docs/CodeHighlighting.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const CodePanel = ({ annotation, children, ...props }: React.PropsWithChildren<I
7777
export const CodeHighlighting: React.FunctionComponent<ICodeHighlightingProps> = ({ className, children, ...props }: React.PropsWithChildren<ICodeHighlightingProps>) => {
7878
const [code, setCode] = React.useState('');
7979

80-
const fetchHighlighter = async (className: string, children: React.ReactNode) => {
80+
const fetchHighlighter = React.useCallback(async (className: string, children: React.ReactNode) => {
8181
const language = className.split('-')[1];
8282
const highlighter = await ShikiService.getHighlighter();
8383

@@ -99,13 +99,13 @@ export const CodeHighlighting: React.FunctionComponent<ICodeHighlightingProps> =
9999

100100
return;
101101
}
102-
};
102+
}, []);
103103

104104
React.useEffect(() => {
105105
if (className && children) {
106106
fetchHighlighter(className, children);
107107
}
108-
}, [className, children]);
108+
}, [className, children, fetchHighlighter]);
109109

110110
const getLanguage = (className: string) => {
111111
const language = className.split('-')[1];

components/Docs/NavGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const NavGroup: React.FunctionComponent<INavGroupProps> = ({
5050
))}
5151
</ul>
5252
);
53-
}, [item, items, router.asPath]);
53+
}, [item, items]);
5454

5555
return (
5656
<Section

pages/api/ai-title.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ const api = async (req: NextApiRequest, res: NextApiResponse) => {
3131
3232
Desired format: just a string, e.g. "My first blog post"`;
3333

34-
const response = await OpenAiService.getCompletion(instruction);
34+
const choices = await OpenAiService.getCompletion(instruction);
3535

36-
const results: string[] = response.choices.map((choice: any) => {
36+
const results: string[] = choices.map((choice: any) => {
3737
let title = choice.text.trim();
3838
if (title.startsWith("1. ")) {
3939
title = title.substring(2, title.length);

public/config/content.pagefolders.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/content.pagefolders.schema.json",
44
"description": "Defines the settings for Front Matter page folder",
5-
"lastModified": "2024-01-26T09:08:14.040Z",
5+
"lastModified": "2024-02-12T08:58:26.062Z",
66
"type": "object",
77
"title": "Front Matter - page folder",
88
"properties": {

public/config/content.placeholders.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/content.placeholders.schema.json",
44
"description": "Defines the settings for Front Matter placeholder",
5-
"lastModified": "2024-01-26T09:08:14.040Z",
5+
"lastModified": "2024-02-12T08:58:26.062Z",
66
"type": "object",
77
"title": "Front Matter - placeholder",
88
"properties": {

public/config/content.snippets.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/content.snippets.schema.json",
44
"description": "Defines the settings for Front Matter snippet",
5-
"lastModified": "2024-01-26T09:08:14.041Z",
5+
"lastModified": "2024-02-12T08:58:26.062Z",
66
"type": "object",
77
"title": "Front Matter - snippet",
88
"required": [

public/config/custom.scripts.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/custom.scripts.schema.json",
44
"description": "Defines the settings for Front Matter custom script",
5-
"lastModified": "2024-01-26T09:08:14.040Z",
5+
"lastModified": "2024-02-12T08:58:26.062Z",
66
"type": "object",
77
"title": "Front Matter - custom script",
88
"properties": {

public/config/data.files.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/data.files.schema.json",
44
"description": "Defines the settings for Front Matter data file",
5-
"lastModified": "2024-01-26T09:08:14.040Z",
5+
"lastModified": "2024-02-12T08:58:26.062Z",
66
"type": "object",
77
"title": "Front Matter - data file",
88
"properties": {

public/config/data.folders.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/data.folders.schema.json",
44
"description": "Defines the settings for Front Matter data folder",
5-
"lastModified": "2024-01-26T09:08:14.040Z",
5+
"lastModified": "2024-02-12T08:58:26.062Z",
66
"type": "object",
77
"title": "Front Matter - data folder",
88
"properties": {

public/config/data.types.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://beta.frontmatter.codes/config/data.types.schema.json",
44
"description": "Defines the settings for Front Matter data type",
5-
"lastModified": "2024-01-26T09:08:14.040Z",
5+
"lastModified": "2024-02-12T08:58:26.062Z",
66
"type": "object",
77
"title": "Front Matter - data type",
88
"properties": {

0 commit comments

Comments
 (0)