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: *
|
||||
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 baseUrls: Array<SitemapURL> = [
|
||||
{ loc: `/`, changefreq: "weekly", priority: 1.0 },
|
||||
{ loc: `/articles/`, changefreq: "weekly", priority: 0.9 },
|
||||
{ loc: `/`, changefreq: "monthly", priority: 1.0 },
|
||||
{ loc: `/articles/`, changefreq: "monthly", priority: 0.9 },
|
||||
{ loc: `/projects/`, changefreq: "monthly", priority: 0.8 },
|
||||
{ loc: `/about/`, changefreq: "monthly", priority: 0.7 },
|
||||
];
|
||||
@ -65,14 +65,15 @@ export async function GET(context: APIContext) {
|
||||
})
|
||||
.join("")}
|
||||
${articleUrls
|
||||
.map((url) => {
|
||||
return `
|
||||
<url>
|
||||
<loc>${url.loc}</loc>
|
||||
${url.langs?.map(({ lang, href }) => `<xhtml:link rel="alternate" hreflang="${lang}" href="${href}"/>`).join("")}
|
||||
</url>
|
||||
`;
|
||||
})
|
||||
.map(
|
||||
(url) =>
|
||||
`
|
||||
<url>
|
||||
<loc>${url.loc}</loc>
|
||||
${url.langs?.map(({ lang, href }) => `<xhtml:link rel="alternate" hreflang="${lang}" href="${href}"/>`).join("")}
|
||||
</url>
|
||||
`
|
||||
)
|
||||
.join("")}
|
||||
</urlset>`;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user