Изменения файла robots.txt
This commit is contained in:
parent
b8661a7b54
commit
71707e495b
6 changed files with 28 additions and 6 deletions
|
|
@ -6,7 +6,7 @@ import RelatedPosts from '@components/blog/RelatedPosts.astro';
|
|||
import ArticleTableOfContents from '@components/blog/ArticleTableOfContents.astro';
|
||||
import { getCollection, getEntry, render } from 'astro:content';
|
||||
|
||||
export const prerender = false;
|
||||
export const prerender = true;
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog') as { id: string; data: Record<string, any> }[];
|
||||
|
|
|
|||
|
|
@ -9,6 +9,18 @@ import CTA from '@components/base/CTA.astro';
|
|||
import SearchModal from '@components/base/SearchModal.astro';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog');
|
||||
const POSTS_PER_PAGE = 6;
|
||||
const totalPages = Math.ceil(posts.length / POSTS_PER_PAGE);
|
||||
|
||||
return Array.from({ length: totalPages }, (_, i) => ({
|
||||
params: { page: String(i + 2) }, // Начинаем со 2-й страницы (1-я это /blog/)
|
||||
}));
|
||||
}
|
||||
|
||||
const posts = await getCollection('blog');
|
||||
|
||||
// Сортируем посты по дате (новые сверху)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue