mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-11 02:19:08 +03:00
sitemap
This commit is contained in:
parent
eca47d8ce3
commit
f3e4b3b9d8
@ -1,4 +1,4 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
Allow: /
|
Allow: /
|
||||||
|
|
||||||
Sitemap: https://yarkov.tech/sitemap-index.xml
|
Sitemap: https://yarkov.tech/sitemap.xml
|
||||||
@ -10,8 +10,8 @@ export async function GET(context: APIContext) {
|
|||||||
const articles = await getArticleList();
|
const articles = await getArticleList();
|
||||||
|
|
||||||
const baseUrls: Array<SitemapURL> = [
|
const baseUrls: Array<SitemapURL> = [
|
||||||
{ loc: `/`, changefreq: "weekly", priority: 1.0 },
|
{ loc: `/`, changefreq: "monthly", priority: 1.0 },
|
||||||
{ loc: `/articles/`, changefreq: "weekly", priority: 0.9 },
|
{ loc: `/articles/`, changefreq: "monthly", priority: 0.9 },
|
||||||
{ loc: `/projects/`, changefreq: "monthly", priority: 0.8 },
|
{ loc: `/projects/`, changefreq: "monthly", priority: 0.8 },
|
||||||
{ loc: `/about/`, changefreq: "monthly", priority: 0.7 },
|
{ loc: `/about/`, changefreq: "monthly", priority: 0.7 },
|
||||||
];
|
];
|
||||||
@ -65,14 +65,15 @@ export async function GET(context: APIContext) {
|
|||||||
})
|
})
|
||||||
.join("")}
|
.join("")}
|
||||||
${articleUrls
|
${articleUrls
|
||||||
.map((url) => {
|
.map(
|
||||||
return `
|
(url) =>
|
||||||
|
`
|
||||||
<url>
|
<url>
|
||||||
<loc>${url.loc}</loc>
|
<loc>${url.loc}</loc>
|
||||||
${url.langs?.map(({ lang, href }) => `<xhtml:link rel="alternate" hreflang="${lang}" href="${href}"/>`).join("")}
|
${url.langs?.map(({ lang, href }) => `<xhtml:link rel="alternate" hreflang="${lang}" href="${href}"/>`).join("")}
|
||||||
</url>
|
</url>
|
||||||
`;
|
`
|
||||||
})
|
)
|
||||||
.join("")}
|
.join("")}
|
||||||
</urlset>`;
|
</urlset>`;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user