diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 8485235..ab96000 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -2,8 +2,6 @@ import { themes as prismThemes } from 'prism-react-renderer'; import type { Config } from '@docusaurus/types'; import type * as Preset from '@docusaurus/preset-classic'; -// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) - const config: Config = { title: 'LearnHub', tagline: 'LearnHub is a platform for learning web development and AI', @@ -11,7 +9,8 @@ const config: Config = { // Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future future: { - v4: true, // Improve compatibility with the upcoming Docusaurus v4 + v4: true, + // Improve compatibility with the upcoming Docusaurus v4 }, // Set the production url of your site here @@ -27,10 +26,12 @@ const config: Config = { onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', + markdown: { mermaid: true, }, themes: ['@docusaurus/theme-mermaid'], + // Even if you don't use internationalization, you can use this field to set // useful metadata like html lang. For example, if your site is Chinese, you // may want to replace "en" with "zh-Hans". @@ -85,11 +86,7 @@ const config: Config = { position: 'left', label: 'Tutorial', }, - { - to: '/blog', - label: 'Blog', - position: 'left' - }, + { to: '/blog', label: 'Blog', position: 'left' }, { type: 'dropdown', label: 'More', @@ -100,14 +97,8 @@ const config: Config = { sidebarId: 'notesSidebar', label: 'Notes', }, - { - to: '/news', - label: 'Tech News' - }, - { - to: '/lectures', - label: 'Video Lectures' - }, + { to: '/news', label: 'Tech News' }, + { to: '/lectures', label: 'Video Lectures' }, { label: 'Code Playground', to: '/docs/code-playground-demo', @@ -163,6 +154,57 @@ const config: Config = { darkTheme: prismThemes.dracula, }, } satisfies Preset.ThemeConfig, -}; + // Correctly placing the headTags property inside the main config object + headTags: [ + { + tagName: 'script', + attributes: { + type: 'application/ld+json', + }, + innerHTML: JSON.stringify({ + "@context": "https://schema.org", + "@type": "Organization", + "name": "LearnHub", + "url": "https://learnhubb.vercel.app/", + "logo": "https://learnhubb.vercel.app/img/logo.png", + "sameAs": [ + "https://github.com/souvikpramanikgit/LearnHub", + "https://discord.gg/YmSKSDfH" + ] + }), + }, + { + tagName: 'script', + attributes: { + type: 'application/ld+json', + }, + innerHTML: JSON.stringify({ + "@context": "https://schema.org", + "@type": "WebSite", + "url": "https://learnhubb.vercel.app/", + "name": "LearnHub", + "potentialAction": { + "@type": "SearchAction", + "target": "https://learnhubb.vercel.app/search?q={search_term_string}", + "query-input": "required name=search_term_string" + } + }), + }, + { + tagName: 'script', + attributes: { + type: 'application/ld+json', + }, + innerHTML: JSON.stringify({ + "@context": "https://schema.org", + "@type": "BreadcrumbList", + "itemListElement": [ + { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://learnhubb.vercel.app/" }, + { "@type": "ListItem", "position": 2, "name": "Courses", "item": "https://learnhubb.vercel.app/courses" } + ] + }), + }, + ], +}; export default config;