Skip to content

Commit 373a162

Browse files
committed
add
1 parent f17607f commit 373a162

File tree

5 files changed

+47
-9
lines changed

5 files changed

+47
-9
lines changed

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"bradlc.vscode-tailwindcss",
4+
"esbenp.prettier-vscode",
5+
"dbaeumer.vscode-eslint"
6+
]
7+
}

.vscode/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"css.validate": false,
3+
"less.validate": false,
4+
"scss.validate": false,
5+
"editor.quickSuggestions": {
6+
"strings": true
7+
},
8+
"tailwindCSS.includeLanguages": {
9+
"typescript": "javascript",
10+
"typescriptreact": "javascript"
11+
},
12+
"editor.codeActionsOnSave": {
13+
"source.fixAll.eslint": true
14+
}
15+
}

pages/courses/[...slug].tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Container from '../../src/components/Container';
1515
import LoadingSpinner from '../../src/components/LoadingSpinner';
1616
import CodeBlock from '../../src/components/CodeBlock';
1717
import PageWrapper from '../../src/components/PageWrapper';
18+
import PageTitle from '../../src/components/PageTitle';
1819

1920
// Add custom styles for content readability
2021
const globalStyles = `
@@ -127,10 +128,10 @@ function MarkdownModule({ source, frontMatter, courseSlug, modules, currentModul
127128

128129
return (
129130
<>
130-
<Head>
131-
<title>{frontMatter.title} | Golang Mastery</title>
132-
<meta name="description" content={frontMatter.description || 'Learn Go programming'} />
133-
</Head>
131+
<PageTitle
132+
title={`${frontMatter.title} | Golang Mastery`}
133+
description={frontMatter.description || 'Learn Go programming'}
134+
/>
134135
<PageWrapper>
135136
<Container maxWidth="xl" padding="lg" className="my-8">
136137
<div className="glass-effect p-6 sm:p-8 rounded-xl content-animate-in">

src/components/ModuleContentLayout.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useState, useEffect } from 'react';
2-
import Head from 'next/head';
32
import ModuleSidebar from './ModuleSidebar';
43
import ModuleNavigation from './ModuleNavigation';
54
import LoadingSpinner from './LoadingSpinner';
65
import Container from './Container';
6+
import PageTitle from './PageTitle';
77

88
interface Module {
99
title: string;
@@ -38,10 +38,10 @@ export default function ModuleContentLayout({
3838

3939
return (
4040
<>
41-
<Head>
42-
<title>{title} | {courseTitle}</title>
43-
<meta name="description" content={`Learn ${title} in the ${courseTitle} course`} />
44-
</Head>
41+
<PageTitle
42+
title={`${title} | ${courseTitle}`}
43+
description={`Learn ${title} in the ${courseTitle} course`}
44+
/>
4545

4646
<div className={`transition-opacity duration-300 ${isLoading ? 'opacity-50' : 'opacity-100'}`}>
4747
<div className="flex flex-col md:flex-row max-w-screen-xl mx-auto gap-6 px-4">

src/components/PageTitle.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Head from 'next/head';
2+
3+
interface PageTitleProps {
4+
title: string;
5+
description?: string;
6+
}
7+
8+
export default function PageTitle({ title, description }: PageTitleProps) {
9+
return (
10+
<Head>
11+
<title>{title}</title>
12+
{description && <meta name="description" content={description} />}
13+
</Head>
14+
);
15+
}

0 commit comments

Comments
 (0)