2025-12-17 23:05:49 +03:00
|
|
|
---
|
|
|
|
|
import MainLayout from '@layouts/MainLayout.astro';
|
2026-01-19 16:28:24 +03:00
|
|
|
import { detectPageType } from '@lib/detect-page-type';
|
2025-12-17 23:05:49 +03:00
|
|
|
|
|
|
|
|
export const prerender = false;
|
|
|
|
|
|
2026-01-19 16:28:24 +03:00
|
|
|
const pathname = Astro.url.pathname; // "/news/society/chto-sluchilos-nochju-27-oktyabrya-2025-goda-1772178/"
|
|
|
|
|
const pageInfo = detectPageType(pathname);
|
2025-12-17 23:05:49 +03:00
|
|
|
|
2026-01-19 16:28:24 +03:00
|
|
|
// Или для полного URL
|
|
|
|
|
const fullUrl = Astro.url.href;
|
|
|
|
|
// Или для origin + pathname
|
|
|
|
|
const fullPath = Astro.url.origin + Astro.url.pathname;
|
2025-12-17 23:05:49 +03:00
|
|
|
---
|
|
|
|
|
|
2026-01-19 16:28:24 +03:00
|
|
|
<MainLayout>
|
|
|
|
|
<div>
|
|
|
|
|
<p><strong>pathname:</strong> {pathname}</p>
|
|
|
|
|
<p><strong>Page Type:</strong> {pageInfo.type}</p>
|
|
|
|
|
<p><strong>Content Type:</strong> {pageInfo.contentType}</p>
|
|
|
|
|
<p><strong>Full URL:</strong> {fullUrl}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</MainLayout>
|