Skip to content

Commit

Permalink
🚀 robots.txt, adjust meta heads (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath authored Apr 11, 2024
1 parent 411fdda commit 81ee7e4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions workspaces/website/src/components/BaseHead.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// all pages through the use of the <BaseHead /> component.
import '../styles/global.css';
import '../components/resume/styles/resume.css';
import { PROFILE_PIC, SITE_TITLE, SITE_DESCRIPTION } from '../consts';
import { PROFILE_PIC, SITE_TITLE, SITE_DESCRIPTION, BLAHG } from '../consts';
export interface Props {
title: string;
Expand All @@ -24,14 +24,11 @@ const { title, description, image = PROFILE_PIC } = Astro.props;
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" href="/favicon-mind-blown.ico" id="favicon" />
<meta name="generator" content={Astro.generator} />
<meta http-equiv='content-language' content='en-us'>
<link rel="sitemap" href="/sitemap-index.xml" />
<meta name="generator" content="Macromedia Dreamweaver 6.0" />
<link rel="preload" as="image" href={image} />
<link
rel="alternate"
type="application/rss+xml"
title={`${SITE_TITLE}, ${SITE_DESCRIPTION}`}
href={`${Astro.site}rss.xml`}
/>
<link rel="alternate" type="application/rss+xml" title={`${BLAHG.title}, ${BLAHG.description}`} href={`${Astro.site}rss.xml`} />

<!-- Canonical URL -->
<link rel="canonical" href={canonicalURL} />
Expand Down
16 changes: 16 additions & 0 deletions workspaces/website/src/pages/robots.txt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { APIRoute } from 'astro';

const robotsTxt = `
User-agent: *
Allow: /
Sitemap: ${new URL('sitemap-index.xml', import.meta.env.SITE).href}
`.trim();

export const GET: APIRoute = () => {
return new Response(robotsTxt, {
headers: {
'Content-Type': 'text/plain; charset=utf-8',
},
});
};

0 comments on commit 81ee7e4

Please sign in to comment.