Enhance meta tags and add robots.txt
Browse filesUpdated meta tags in +layout.svelte for improved SEO and social sharing, including more detailed Twitter and Open Graph tags. Added robots.txt to control crawler access and reference sitemap.
- src/routes/+layout.svelte +11 -2
- static/robots.txt +10 -0
src/routes/+layout.svelte
CHANGED
|
@@ -182,19 +182,28 @@
|
|
| 182 |
</script>
|
| 183 |
|
| 184 |
<svelte:head>
|
| 185 |
-
<title>{publicConfig.PUBLIC_APP_NAME}</title>
|
| 186 |
<meta name="description" content={publicConfig.PUBLIC_APP_DESCRIPTION} />
|
| 187 |
<meta name="twitter:card" content="summary_large_image" />
|
| 188 |
<meta name="twitter:site" content="@huggingface" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
|
| 190 |
<!-- use those meta tags everywhere except on special listing pages -->
|
| 191 |
<!-- feel free to refacto if there's a better way -->
|
| 192 |
{#if !page.url.pathname.includes("/models/")}
|
| 193 |
-
<meta property="og:title" content={publicConfig.PUBLIC_APP_NAME} />
|
| 194 |
<meta property="og:type" content="website" />
|
| 195 |
<meta property="og:url" content="{publicConfig.PUBLIC_ORIGIN || page.url.origin}{base}" />
|
| 196 |
<meta property="og:image" content="{publicConfig.assetPath}/thumbnail.png" />
|
| 197 |
<meta property="og:description" content={publicConfig.PUBLIC_APP_DESCRIPTION} />
|
|
|
|
|
|
|
| 198 |
{/if}
|
| 199 |
<link rel="icon" href="{publicConfig.assetPath}/icon.svg" type="image/svg+xml" />
|
| 200 |
{#if publicConfig.PUBLIC_ORIGIN}
|
|
|
|
| 182 |
</script>
|
| 183 |
|
| 184 |
<svelte:head>
|
| 185 |
+
<title>{publicConfig.PUBLIC_APP_NAME} - Chat with AI models</title>
|
| 186 |
<meta name="description" content={publicConfig.PUBLIC_APP_DESCRIPTION} />
|
| 187 |
<meta name="twitter:card" content="summary_large_image" />
|
| 188 |
<meta name="twitter:site" content="@huggingface" />
|
| 189 |
+
<meta name="twitter:title" content="{publicConfig.PUBLIC_APP_NAME} - Chat with AI models" />
|
| 190 |
+
<meta name="twitter:description" content={publicConfig.PUBLIC_APP_DESCRIPTION} />
|
| 191 |
+
<meta
|
| 192 |
+
name="twitter:image"
|
| 193 |
+
content="{publicConfig.PUBLIC_ORIGIN || page.url.origin}{publicConfig.assetPath}/thumbnail.png"
|
| 194 |
+
/>
|
| 195 |
+
<meta name="twitter:image:alt" content="{publicConfig.PUBLIC_APP_NAME} preview" />
|
| 196 |
|
| 197 |
<!-- use those meta tags everywhere except on special listing pages -->
|
| 198 |
<!-- feel free to refacto if there's a better way -->
|
| 199 |
{#if !page.url.pathname.includes("/models/")}
|
| 200 |
+
<meta property="og:title" content="{publicConfig.PUBLIC_APP_NAME} - Chat with AI models" />
|
| 201 |
<meta property="og:type" content="website" />
|
| 202 |
<meta property="og:url" content="{publicConfig.PUBLIC_ORIGIN || page.url.origin}{base}" />
|
| 203 |
<meta property="og:image" content="{publicConfig.assetPath}/thumbnail.png" />
|
| 204 |
<meta property="og:description" content={publicConfig.PUBLIC_APP_DESCRIPTION} />
|
| 205 |
+
<meta property="og:site_name" content={publicConfig.PUBLIC_APP_NAME} />
|
| 206 |
+
<meta property="og:locale" content="en_US" />
|
| 207 |
{/if}
|
| 208 |
<link rel="icon" href="{publicConfig.assetPath}/icon.svg" type="image/svg+xml" />
|
| 209 |
{#if publicConfig.PUBLIC_ORIGIN}
|
static/robots.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
User-agent: *
|
| 2 |
+
Allow: /
|
| 3 |
+
Allow: /r/
|
| 4 |
+
Disallow: /conversation/
|
| 5 |
+
Disallow: /api/
|
| 6 |
+
Disallow: /login
|
| 7 |
+
Disallow: /logout
|
| 8 |
+
|
| 9 |
+
# Sitemap
|
| 10 |
+
# Sitemap: https://huggingface.co/chat/sitemap.xml
|