all local
Deploy to FTP / deploy (push) Successful in 6s

This commit is contained in:
Sebastian Molenda
2026-05-26 21:58:38 +02:00
parent 3cf616ad11
commit c26165bfb7
25 changed files with 1304 additions and 66 deletions
+14
View File
@@ -0,0 +1,14 @@
// Komponenty HTML loader
function loadComponent(path, replaceMap = {}) {
return fetch(path)
.then(r => r.text())
.then(html => {
Object.entries(replaceMap).forEach(([key, val]) => {
html = html.replaceAll(key, val);
});
return html;
});
}
// Przykład użycia:
// loadComponent('components/header.html', {'{TITLE}': 'Tytuł', '{SUBTITLE}': 'Podtytuł'}).then(html => ...)