Skip to content

Commit ef72b8d

Browse files
committed
Enhance meta tags and add robots.txt
Updated 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.
1 parent a10e9c3 commit ef72b8d

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/routes/+layout.svelte

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,28 @@
182182
</script>
183183

184184
<svelte:head>
185-
<title>{publicConfig.PUBLIC_APP_NAME}</title>
185+
<title>{publicConfig.PUBLIC_APP_NAME} - Chat with AI models</title>
186186
<meta name="description" content={publicConfig.PUBLIC_APP_DESCRIPTION} />
187187
<meta name="twitter:card" content="summary_large_image" />
188188
<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" />
189196

190197
<!-- use those meta tags everywhere except on special listing pages -->
191198
<!-- feel free to refacto if there's a better way -->
192199
{#if !page.url.pathname.includes("/models/")}
193-
<meta property="og:title" content={publicConfig.PUBLIC_APP_NAME} />
200+
<meta property="og:title" content="{publicConfig.PUBLIC_APP_NAME} - Chat with AI models" />
194201
<meta property="og:type" content="website" />
195202
<meta property="og:url" content="{publicConfig.PUBLIC_ORIGIN || page.url.origin}{base}" />
196203
<meta property="og:image" content="{publicConfig.assetPath}/thumbnail.png" />
197204
<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" />
198207
{/if}
199208
<link rel="icon" href="{publicConfig.assetPath}/icon.svg" type="image/svg+xml" />
200209
{#if publicConfig.PUBLIC_ORIGIN}

static/robots.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)