feat: add opentags
All checks were successful
Deploy to SFTP Server / build (push) Successful in 4m0s
All checks were successful
Deploy to SFTP Server / build (push) Successful in 4m0s
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { getCollection, render } from "astro:content";
|
||||
import { getLocale } from "astro-i18n-aut";
|
||||
import { filterCollection, parseSlug } from "@i18n/utils";
|
||||
import MetaTags from "@components/MetaTags.astro";
|
||||
|
||||
const locale = getLocale(Astro.url);
|
||||
|
||||
@@ -31,4 +32,5 @@ if (!page) {
|
||||
const { Content } = await render(page);
|
||||
---
|
||||
|
||||
<MetaTags title={page.data.title} cover={page.data.cover?.src} />
|
||||
<Content />
|
||||
|
@@ -2,6 +2,7 @@
|
||||
import { getCollection, render } from "astro:content";
|
||||
import { getLocale } from "astro-i18n-aut";
|
||||
import { filterCollection, parseSlug } from "@i18n/utils";
|
||||
import MetaTags from "@components/MetaTags.astro";
|
||||
|
||||
const locale = getLocale(Astro.url);
|
||||
|
||||
@@ -31,4 +32,5 @@ if (!page) {
|
||||
const { Content } = await render(page);
|
||||
---
|
||||
|
||||
<MetaTags title={page.data.title} cover={page.data.cover?.src} />
|
||||
<Content />
|
||||
|
@@ -2,6 +2,7 @@
|
||||
import { getCollection, render } from "astro:content";
|
||||
import { getLocale } from "astro-i18n-aut";
|
||||
import { filterCollection, parseSlug } from "@i18n/utils";
|
||||
import MetaTags from "@components/MetaTags.astro";
|
||||
|
||||
const locale = getLocale(Astro.url);
|
||||
|
||||
@@ -31,4 +32,5 @@ if (!page) {
|
||||
const { Content } = await render(page);
|
||||
---
|
||||
|
||||
<MetaTags title={page.data.title} cover={page.data.cover?.src} />
|
||||
<Content />
|
||||
|
13
src/pages/robots.txt.ts
Normal file
13
src/pages/robots.txt.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { APIRoute } from 'astro';
|
||||
|
||||
const getRobotsTxt = (sitemapURL: URL) => `
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
Sitemap: ${sitemapURL.href}
|
||||
`;
|
||||
|
||||
export const GET: APIRoute = ({ site }) => {
|
||||
const sitemapURL = new URL('sitemap-index.xml', site);
|
||||
return new Response(getRobotsTxt(sitemapURL));
|
||||
};
|
Reference in New Issue
Block a user