Skip to content

Commit

Permalink
cleanup docs title
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrrt committed Dec 20, 2023
1 parent d1ea735 commit 85ee8c7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
20 changes: 20 additions & 0 deletions apps/docs/theme.config.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from "react";
import { DocsThemeConfig } from "nextra-theme-docs";
import { GiHydra } from "react-icons/gi";
import { useRouter } from "next/router";
import { useConfig } from "nextra-theme-docs";

const config: DocsThemeConfig = {
logo: (
Expand Down Expand Up @@ -30,6 +32,24 @@ const config: DocsThemeConfig = {
),
},
faviconGlyph: "🐉",
head: () => {
const { asPath, defaultLocale, locale } = useRouter();
const { frontMatter } = useConfig();
const url =
"https://my-app.com" +
(defaultLocale === locale ? asPath : `/${locale}${asPath}`);

return (
<>
<meta property="og:url" content={url} />
<meta property="og:title" content={frontMatter.title} />
<meta
property="og:description"
content={frontMatter.description || "Hydra Documentation"}
/>
</>
);
},
};

export default config;
9 changes: 6 additions & 3 deletions packages/cli/src/commands/generate-schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ describe("generate schema command", () => {
const defaultHydraSchemaRawPath = "./.hydra/schemaRaw.js";

try {

// check if .hydra/schemaRaw.js exists
const schemaFileExistsBeforeCommand = await checkFileExists(defaultHydraSchemaRawPath);
const schemaFileExistsBeforeCommand = await checkFileExists(
defaultHydraSchemaRawPath,
);
if (schemaFileExistsBeforeCommand) {
// remove the file if it exists
await fs.unlink(defaultHydraSchemaRawPath);
Expand All @@ -30,7 +31,9 @@ describe("generate schema command", () => {
config: configPath,
});
// Check if the schema file exists after generation
const schemaFileExistsAfterCommand = await checkFileExists(defaultHydraSchemaRawPath);
const schemaFileExistsAfterCommand = await checkFileExists(
defaultHydraSchemaRawPath,
);
expect(schemaFileExistsAfterCommand).toBeTruthy();
// Remove the generated schema file after validation
await fs.unlink(defaultHydraSchemaRawPath);
Expand Down

0 comments on commit 85ee8c7

Please sign in to comment.