Skip to content
Open
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
76 changes: 59 additions & 17 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ 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',
favicon: 'img/learnhub.png',

// 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
Expand All @@ -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".
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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;