Seo - korekta plus nowe obrazki og
This commit is contained in:
1425
astro-pages-dump.txt
Normal file
1425
astro-pages-dump.txt
Normal file
File diff suppressed because it is too large
Load Diff
95
astro.py
Normal file
95
astro.py
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
import argparse
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def iter_astro_files(root: Path) -> list[Path]:
|
||||||
|
"""Zwraca listę plików .astro w root (rekursywnie), posortowaną stabilnie."""
|
||||||
|
files = [p for p in root.rglob("*.astro") if p.is_file()]
|
||||||
|
# sortowanie po ścieżce względnej dla powtarzalności
|
||||||
|
files.sort(key=lambda p: str(p.as_posix()).lower())
|
||||||
|
return files
|
||||||
|
|
||||||
|
|
||||||
|
def read_text_fallback(p: Path) -> str:
|
||||||
|
"""
|
||||||
|
Czyta plik jako tekst:
|
||||||
|
- najpierw UTF-8
|
||||||
|
- jeśli się nie da, to z BOM/latin-1 jako awaryjne (bez crasha)
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return p.read_text(encoding="utf-8")
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
# Spróbuj UTF-8 z BOM
|
||||||
|
try:
|
||||||
|
return p.read_text(encoding="utf-8-sig")
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
# Ostatecznie: latin-1 (nie idealne, ale nie przerwie działania)
|
||||||
|
return p.read_text(encoding="latin-1")
|
||||||
|
|
||||||
|
|
||||||
|
def build_output(pages_dir: Path, files: list[Path]) -> str:
|
||||||
|
rel_root = pages_dir.parent.parent # zwykle ./src -> parent parent? NIEPEWNE, więc liczymy inaczej
|
||||||
|
# lepiej: relatywnie do katalogu projektu (cwd)
|
||||||
|
cwd = Path.cwd()
|
||||||
|
|
||||||
|
lines: list[str] = []
|
||||||
|
lines.append(f"ASTRO DUMP (root: {pages_dir.resolve()})")
|
||||||
|
lines.append(f"Found files: {len(files)}")
|
||||||
|
lines.append("=" * 80)
|
||||||
|
lines.append("")
|
||||||
|
|
||||||
|
for f in files:
|
||||||
|
rel = f.relative_to(cwd) if f.is_relative_to(cwd) else f
|
||||||
|
content = read_text_fallback(f)
|
||||||
|
|
||||||
|
lines.append(f"FILE: {rel.as_posix()}")
|
||||||
|
lines.append("-" * 80)
|
||||||
|
lines.append(content.rstrip("\n"))
|
||||||
|
lines.append("")
|
||||||
|
lines.append("=" * 80)
|
||||||
|
lines.append("")
|
||||||
|
|
||||||
|
return "\n".join(lines)
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> int:
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description="Zrzuca wszystkie pliki .astro z ./src/pages do jednego pliku txt (ścieżka + zawartość)."
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--pages",
|
||||||
|
default="src/pages",
|
||||||
|
help="Ścieżka do katalogu pages (domyślnie: src/pages)",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--out",
|
||||||
|
default="astro-pages-dump.txt",
|
||||||
|
help="Plik wyjściowy (domyślnie: astro-pages-dump.txt)",
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
pages_dir = Path(args.pages).resolve()
|
||||||
|
out_file = Path(args.out).resolve()
|
||||||
|
|
||||||
|
if not pages_dir.exists() or not pages_dir.is_dir():
|
||||||
|
print(f"[ERR] Nie znaleziono katalogu: {pages_dir}", file=sys.stderr)
|
||||||
|
return 2
|
||||||
|
|
||||||
|
files = iter_astro_files(pages_dir)
|
||||||
|
|
||||||
|
dump = build_output(pages_dir, files)
|
||||||
|
|
||||||
|
out_file.write_text(dump, encoding="utf-8")
|
||||||
|
print(f"[OK] Zapisano: {out_file} (files: {len(files)})")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
raise SystemExit(main())
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 221 KiB After Width: | Height: | Size: 272 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 283 KiB After Width: | Height: | Size: 226 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 301 KiB After Width: | Height: | Size: 285 KiB |
@@ -1,6 +1,6 @@
|
|||||||
site:
|
site:
|
||||||
name: "FUZ – Internet światłowodowy w Wyszkowie"
|
name: "FUZ Kontakt"
|
||||||
description: "Stabilny i szybki internet w Wyszkowie i okolicach"
|
description: "Skontaktuj się z nami. Stabilny i szybki internet w Wyszkowie i okolicach"
|
||||||
url: "https://www.fuz.pl"
|
url: "https://www.fuz.pl"
|
||||||
lang: "pl"
|
lang: "pl"
|
||||||
|
|
||||||
@@ -17,11 +17,12 @@ company:
|
|||||||
logo: "/logo.webp"
|
logo: "/logo.webp"
|
||||||
|
|
||||||
page:
|
page:
|
||||||
title: "FUZ – Internet światłowodowy w Wyszkowie"
|
title: "FUZ Kontakt"
|
||||||
description: "Szybki, stabilny internet światłowodowy w Wyszkowie. Lokalny operator, realny serwis, błyskawiczne wsparcie."
|
description: "Szybki, stabilny internet światłowodowy w Wyszkowie. Lokalny operator, realny serwis, błyskawiczne wsparcie."
|
||||||
image: "/og/internet-og.png"
|
image: "/og/home-og.png"
|
||||||
url: "/internet-swiatlowodowy"
|
url: "/kontakt"
|
||||||
keywords:
|
keywords:
|
||||||
|
- kontakt internet światłowodowy Wyszków
|
||||||
- internet Wyszków
|
- internet Wyszków
|
||||||
- światłowód Wyszków
|
- światłowód Wyszków
|
||||||
- internet światłowodowy Wyszków
|
- internet światłowodowy Wyszków
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
site:
|
site:
|
||||||
name: "FUZ – Internet światłowodowy w Wyszkowie"
|
name: "FUZ Internet światłowodowy w Wyszkowie"
|
||||||
description: "Stabilny i szybki internet"
|
description: "Stabilny i szybki internet"
|
||||||
url: "https://www.fuz.pl"
|
url: "https://www.fuz.pl"
|
||||||
lang: "pl"
|
lang: "pl"
|
||||||
@@ -17,10 +17,10 @@ company:
|
|||||||
logo: "/logo.webp"
|
logo: "/logo.webp"
|
||||||
|
|
||||||
page:
|
page:
|
||||||
title: "FUZ – Internet światłowodowy w Wyszkowie"
|
title: "FUZ Internet światłowodowy w Wyszkowie"
|
||||||
description: "Szybki, stabilny internet światłowodowy w Wyszkowie. Lokalny operator, realny serwis, błyskawiczne wsparcie."
|
description: "Szybki, stabilny internet światłowodowy w Wyszkowie. Lokalny operator, realny serwis, błyskawiczne wsparcie."
|
||||||
image: "/og/home-og.png"
|
image: "/og/home-og.png"
|
||||||
url: "/internet-swiatlowodowy"
|
url: "/"
|
||||||
keywords:
|
keywords:
|
||||||
- internet Wyszków
|
- internet Wyszków
|
||||||
- światłowód Wyszków
|
- światłowód Wyszków
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
site:
|
site:
|
||||||
name: "FUZ – Internet światłowodowy w Wyszkowie"
|
name: "FUZ Internet światłowodowy w Wyszkowie"
|
||||||
description: "Stabilny i szybki internet w Wyszkowie i okolicach"
|
description: "Stabilny i szybki internet w Wyszkowie i okolicach"
|
||||||
url: "https://www.fuz.pl"
|
url: "https://www.fuz.pl"
|
||||||
lang: "pl"
|
lang: "pl"
|
||||||
@@ -17,10 +17,10 @@ company:
|
|||||||
logo: "/logo.webp"
|
logo: "/logo.webp"
|
||||||
|
|
||||||
page:
|
page:
|
||||||
title: "FUZ – Internet światłowodowy w Wyszkowie"
|
title: "FUZ Internet światłowodowy w Wyszkowie"
|
||||||
description: "Szybki, stabilny internet światłowodowy w Wyszkowie. Lokalny operator, realny serwis, błyskawiczne wsparcie."
|
description: "Szybki, stabilny internet światłowodowy w Wyszkowie. Lokalny operator, realny serwis, błyskawiczne wsparcie."
|
||||||
image: "/images/og-home.webp"
|
image: "/images/internet-og.webp"
|
||||||
url: "/"
|
url: "/internet-swiatlowodowy"
|
||||||
keywords:
|
keywords:
|
||||||
- internet Wyszków
|
- internet Wyszków
|
||||||
- światłowód Wyszków
|
- światłowód Wyszków
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
site:
|
site:
|
||||||
name: "FUZ – Internet światłowodowy z Telewizją w Wyszkowie"
|
name: "FUZ Telewizja z Internetem światłowodowym w Wyszkowie"
|
||||||
description: "Stabilny i szybki internet z telewizją"
|
description: "Stabilny i szybki internet z telewizją"
|
||||||
url: "https://www.fuz.pl"
|
url: "https://www.fuz.pl"
|
||||||
lang: "pl"
|
lang: "pl"
|
||||||
@@ -17,12 +17,13 @@ company:
|
|||||||
logo: "/logo.webp"
|
logo: "/logo.webp"
|
||||||
|
|
||||||
page:
|
page:
|
||||||
title: "FUZ – Internet światłowodowy z Telewizją w Wyszkowie"
|
title: "FUZ Telewizja z Internetem światłowodowym w Wyszkowie"
|
||||||
description: "Szybki, stabilny internet światłowodowy z telewizją w Wyszkowie. Lokalny operator, realny serwis, błyskawiczne wsparcie."
|
description: "Szybki, stabilny internet światłowodowy z telewizją w Wyszkowie. Lokalny operator, realny serwis, błyskawiczne wsparcie."
|
||||||
image: "/og/telewizja-og.png"
|
image: "/og/telewizja-og.png"
|
||||||
url: "/internet-telewizja"
|
url: "/internet-telewizja"
|
||||||
keywords:
|
keywords:
|
||||||
- internet z telewiazją Wyszków
|
- internet z telewiazją Wyszków
|
||||||
|
- internet telewiazja Wyszków
|
||||||
- światłowód telewizja Wyszków
|
- światłowód telewizja Wyszków
|
||||||
- internet światłowodowy telewizja Wyszków
|
- internet światłowodowy telewizja Wyszków
|
||||||
- lokalny operator internetu Wyszków
|
- lokalny operator internetu Wyszków
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
site:
|
site:
|
||||||
name: "FUZ – Internet światłowodowy plus Telefon w Wyszkowie"
|
name: "FUZ Telefon i Internet światłowodowy w Wyszkowie"
|
||||||
description: "Stabilny i szybki internet"
|
description: "Usługa telefonu wraz z stabilnym i szybkim internet"
|
||||||
url: "https://www.fuz.pl"
|
url: "https://www.fuz.pl"
|
||||||
lang: "pl"
|
lang: "pl"
|
||||||
|
|
||||||
@@ -17,15 +17,17 @@ company:
|
|||||||
logo: "/logo.webp"
|
logo: "/logo.webp"
|
||||||
|
|
||||||
page:
|
page:
|
||||||
title: "FUZ – Internet światłowodowy w Wyszkowie"
|
title: "FUZ Telefon i Internet światłowodowy w Wyszkowie"
|
||||||
description: "Szybki, stabilny internet światłowodowy w Wyszkowie. Lokalny operator, realny serwis, błyskawiczne wsparcie."
|
description: "Szybki, stabilny internet światłowodowy w Wyszkowie z usługa telefonu. Lokalny operator, realny serwis, błyskawiczne wsparcie."
|
||||||
image: "/og/telefon-og.png"
|
image: "/og/telefon-og.png"
|
||||||
url: "/telefon"
|
url: "/telefon"
|
||||||
keywords:
|
keywords:
|
||||||
|
- telefon
|
||||||
|
- telefon Wyszków
|
||||||
|
- telefon internet Wyszków
|
||||||
- internet Wyszków
|
- internet Wyszków
|
||||||
- światłowód Wyszków
|
- światłowód Wyszków
|
||||||
- internet światłowodowy Wyszków
|
- internet światłowodowy Wyszków
|
||||||
- lokalny operator internetu Wyszków
|
- lokalny operator internetu Wyszków
|
||||||
- telefon
|
|
||||||
- telefon Wyszków
|
|
||||||
schema: {}
|
schema: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user