Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: meta tags #59

Merged
merged 2 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
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
14 changes: 6 additions & 8 deletions components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ export const Layout = ({ children }: Props) => {
<Head>
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Title</title>

<meta name="description" content="Description" />
<meta property="og:title" content="Title" />
<meta property="og:description" content="Description" />
<meta property="og:image" content="https://www.mywebsite.com/image.jpg" />
<meta property="og:image:alt" content="Image alt" />
{/*<title>Title</title>*/}
{/*<meta name="description" content="Description" />*/}
{/*<meta property="og:title" content="Title" />*/}
{/*<meta property="og:description" content="Description" />*/}
{/*<meta property="og:image" content="https://www.mywebsite.com/image.jpg" />*/}
{/*<meta property="og:image:alt" content="Image alt" />*/}
<meta property="og:locale" content="ru_RU" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary_large_image" />
Expand Down
5 changes: 4 additions & 1 deletion pages/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export default function ArticlePage({ code, frontMatter, tableOfContents }: Prop
<Layout>
<Head>
<title>{frontMatter.title}</title>
<meta name="description" content={frontMatter.description} />
{frontMatter.description && <meta name="description" content={frontMatter.description} />}
<meta property="og:type" content="article" />
<meta property="og:title" content={frontMatter.title} />
{frontMatter.description && <meta property="og:description" content={frontMatter.description} />}
</Head>
<HeaderArticle />
<main className="container mx-auto flex">
Expand Down
9 changes: 9 additions & 0 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ const Home = ({ sections }: Props) => {
<Layout>
<Head>
<title>Курс по теории машинного обучения от Школы Анализа Данных</title>
<meta
name="description"
content="Перед вами учебник по машинному обучению. Он состоит из двух частей — основного курса теории, который надлежит читать подряд, и набора статей отвечающих на вопросы возникающие в реальной практике аналитика или ML-инженера."
/>
<meta property="og:title" content="Курс по теории машинного обучения от Школы Анализа Данных" />
<meta
property="og:description"
content="Перед вами учебник по машинному обучению. Он состоит из двух частей — основного курса теории, который надлежит читать подряд, и набора статей отвечающих на вопросы возникающие в реальной практике аналитика или ML-инженера."
/>
</Head>
<Header />
<Main sections={sections} />
Expand Down