Skip to content

Commit

Permalink
feat: add basic metadata infos
Browse files Browse the repository at this point in the history
  • Loading branch information
NDOY3M4N committed Nov 15, 2023
1 parent cf3ac8a commit 2f44bde
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export { default as Steps } from "./steps.svelte";
export { default as Code } from "./markdown/code.svelte";
export { default as APISection } from "./api-section.svelte";
export { default as ComponentPreview } from "./component-preview.svelte";
export { default as Metadata } from "./metadata.svelte";
15 changes: 15 additions & 0 deletions src/components/metadata.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script lang="ts">
import { page } from "$app/stores";
import { siteConfig } from "@/config";
export let title: string = siteConfig.name;
$: title = $page.data?.title ? `${$page.data.title} - ${siteConfig.name}` : siteConfig.name;
</script>

<svelte:head>
<title>{title}</title>
<meta name="description" content={siteConfig.description} />
<meta name="keywords" content={siteConfig.keywords} />
<meta name="author" content="huntabyte" />
</svelte:head>
4 changes: 2 additions & 2 deletions src/config/site.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const siteConfig = {
name: "Bit UI",
url: "https://bit-ui.com",
name: "Bits UI",
url: "https://bits-ui.com",
description: "Headless components for Svelte built on top of Melt UI.",
links: {
melt: "https://melt-ui.com",
Expand Down
3 changes: 2 additions & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { dev } from "$app/environment";
import { SidebarNav, SiteHeader, TailwindIndicator } from "@/components";
import { Metadata, SidebarNav, SiteHeader, TailwindIndicator } from "@/components";
import { setInitialClassState } from "@/components/light-switch/light-switch";
import { navigation } from "@/config";
import "@/styles/app.postcss";
Expand All @@ -10,6 +10,7 @@
<!-- This causes the new eslint-plugin-svelte: https://github.com/sveltejs/eslint-plugin-svelte/issues/492 -->
{@html `<\u{73}cript nonce="%sveltekit.nonce%">(${setInitialClassState.toString()})();</script>`}
</svelte:head>
<Metadata />

<SiteHeader />
<main class="min-h-[calc(100vh-64px)]">
Expand Down

0 comments on commit 2f44bde

Please sign in to comment.