|
31 | 31 | import type { Author, Content } from '$lib/types'; |
32 | 32 | import { analyticsLogPageView } from '$lib/client/firebase'; |
33 | 33 | import CannyButton from './(feedback)/CannyButton.svelte'; |
| 34 | + import MetaTags from './MetaTags.svelte'; |
34 | 35 |
|
35 | 36 | // Scroll heading into view |
36 | 37 | function scrollHeadingIntoView(): void { |
|
89 | 90 |
|
90 | 91 | let content: (Content & Author) | undefined = undefined; |
91 | 92 | let authors: Author[] | undefined = undefined; |
| 93 | + let topLevelPage: boolean | undefined = false; |
92 | 94 | page.subscribe((page) => { |
| 95 | + topLevelPage = page?.route?.id?.includes('top-level-pages'); |
| 96 | + console.log(topLevelPage); |
| 97 | +
|
93 | 98 | content = page?.data?.content || page?.data?.course; |
94 | 99 | authors = page?.data?.authors; |
95 | 100 |
|
|
125 | 130 | }); |
126 | 131 | </script> |
127 | 132 |
|
128 | | -<svelte:head> |
129 | | - <title>{meta.title}</title> |
130 | | - <!-- Meta Tags --> |
131 | | - <meta name="title" content={meta.title} /> |
132 | | - <meta name="description" content={meta.description} /> |
133 | | - <meta name="keywords" content="codingcatdev, webdev, webdevelopment, learning, beginner" /> |
134 | | - <meta name="theme-color" content="#6366f1" /> |
135 | | - <meta name="author" content="CodingCatDev, LLC" /> |
136 | | - <!-- Open Graph - https://ogp.me/ --> |
137 | | - <meta property="og:site_name" content="CodingCat.dev" /> |
138 | | - <meta property="og:type" content="website" /> |
139 | | - <meta property="og:url" content="https://codingcat.dev{$page.url.pathname}" /> |
140 | | - <meta property="og:locale" content="en_US" /> |
141 | | - <meta property="og:title" content={meta.title} /> |
142 | | - <meta property="og:description" content={meta.description} /> |
143 | | - <meta property="og:image" content={meta.image} /> |
144 | | - <meta property="og:image:secure_url" content={meta.image} /> |
145 | | - <meta property="og:image:type" content="image/jpg" /> |
146 | | - <meta property="og:image:width" content="1920" /> |
147 | | - <meta property="og:image:height" content="1080" /> |
148 | | - |
149 | | - <!-- OG: Article --> |
150 | | - {#if content} |
151 | | - <meta property="article:published_time" content={meta.article.publishTime} /> |
152 | | - <meta property="article:modified_time" content={meta.article.modifiedTime} /> |
153 | | - <meta property="article:author" content={meta.article.author} /> |
154 | | - {/if} |
155 | | - |
156 | | - <!-- Open Graph: Twitter --> |
157 | | - <meta name="twitter:card" content="summary_large_image" /> |
158 | | - <meta name="twitter:site" content="@CodingCatDev" /> |
159 | | - <meta name="twitter:creator" content="@CodingCatDev" /> |
160 | | - <meta name="twitter:title" content={meta.twitter.title} /> |
161 | | - <meta name="twitter:description" content={meta.twitter.description} /> |
162 | | - <meta name="twitter:image" content={meta.twitter.image} /> |
163 | | -</svelte:head> |
| 133 | +{#if !topLevelPage} |
| 134 | + <MetaTags {meta} {content} page={$page} /> |
| 135 | +{/if} |
164 | 136 |
|
165 | 137 | <!-- Overlays --> |
166 | 138 | <CcdDrawer /> |
|
0 commit comments