From 6828c3f8350324db1f967a6a4887a15b95a9674f Mon Sep 17 00:00:00 2001 From: Markus Date: Tue, 2 Sep 2025 22:21:50 +0200 Subject: [PATCH] Update020920252221 --- config/_default/params.toml | 6 +- layouts/_default/contact.html | 105 +++++++++--------- layouts/partials/head.html | 18 +++ layouts/partials/script.html | 11 +- static/send.php | 39 ++++--- .../layouts/_default/baseof.html | 21 ++++ .../airspace-hugo/layouts/partials/head.html | 7 ++ 7 files changed, 130 insertions(+), 77 deletions(-) diff --git a/config/_default/params.toml b/config/_default/params.toml index 47ed15e..4f87d36 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -60,9 +60,9 @@ link = "contact" # matomo tracking: see https://matomo.org/ [matomo] -enable = false -url = "" # your matomo url -id = "" # your matomo id +enable = true +url = "https://matomo.amperion.at" # your matomo url +id = "1" # your matomo id # site verifications diff --git a/layouts/_default/contact.html b/layouts/_default/contact.html index 96a15e5..89111af 100644 --- a/layouts/_default/contact.html +++ b/layouts/_default/contact.html @@ -30,9 +30,8 @@ .stack{display:grid;gap:16px} .stack-lg{display:grid;gap:24px} .info-list{list-style:none;margin:0;padding:0;display:grid;gap:12px} - .info-item{display:flex;gap:.75rem;align-items:flex-start; justify-content:center; text-align:center} - .info-item .ico{flex:0 0 auto;line-height:0} - .info-item .txt a{ text-decoration:none;color:inherit; } + .info-item{display:flex;gap:.75rem;align-items:flex-start} + .info-item .ico{flex:0 0 auto;line-height:0;color:#F5A623} /* CTA-Buttons & Socials: nutzt eure bestehenden Klassen – nur Layout-Hooks */ .cta__actions{display:flex;gap:.75rem;flex-wrap:wrap} @@ -51,8 +50,8 @@ } textarea.form-control{min-height:160px;resize:vertical} .form-control:focus{border-color:#F5A623;box-shadow:0 0 0 3px rgba(245,166,35,.18)} - .form-legal{margin:0;opacity:.9} - .card h3{margin:0 0 .5rem} + .form-legal{margin:0;opacity:.9} /* p-Standardgröße bleibt erhalten */ + .card h3{margin:0 0 .5rem} /* nur Abstand, Typo kommt global von h3 */
@@ -64,41 +63,34 @@

Kontakt

-
    - {{ with $addr }} -
  • - -
    {{ . | markdownify }}
    -
  • - {{ end }} - - {{ with $email }} -
  • - -
    - {{ . }} -
    -
  • - {{ end }} - - {{ with $phone1 }} -
  • - -
    - {{ . }} -
    -
  • - {{ end }} - - {{ with $phone2 }} -
  • - -
    - {{ . }} -
    -
  • - {{ end }} -
+
    + 📍{{ with $addr }} +
  • +
    {{ . | markdownify }}
    +
  • + {{ end }} + 📧{{ with $email }} +
  • +
    + {{ . }} +
    +
  • + {{ end }} + 📞{{ with $phone1 }} +
  • +
    + {{ . }} +
    +
  • + {{ end }} + {{ with $phone2 }} +
  • +
    + {{ . }} +
    +
  • + {{ end }} +
@@ -120,7 +112,7 @@
-
+
@@ -146,25 +138,17 @@
- - +
-
- -
-
- {{/* Reveal Init (falls global nicht vorhanden) */}} + + -{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index b771aab..66c6695 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -75,3 +75,21 @@ {{- $scss := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "scss/style.scss" . | toCSS (dict "targetPath" "css/style.css") | minify -}} + + + + + + diff --git a/layouts/partials/script.html b/layouts/partials/script.html index 6121dd5..a4880f8 100644 --- a/layouts/partials/script.html +++ b/layouts/partials/script.html @@ -131,11 +131,10 @@ tarteaucitron.init({ + + \ No newline at end of file diff --git a/static/send.php b/static/send.php index bfe0538..9030ca8 100644 --- a/static/send.php +++ b/static/send.php @@ -1,19 +1,25 @@ Server-Konfigurationsfehler. Bitte später erneut versuchen.

"; + exit; +} // Formulardaten abrufen $name = $_POST["name"] ?? ''; @@ -42,19 +48,20 @@ curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'remoteip' => $_SERVER['REMOTE_ADDR'] ?? null, ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - $response = curl_exec($ch); if ($response === false) { error_log("cURL-Fehler bei hCaptcha: " . curl_error($ch)); + echo "

Server-Fehler. Bitte später erneut versuchen.

"; + exit; } curl_close($ch); - $response_data = json_decode($response, true); // E-Mail mit PHPMailer senden, wenn Captcha ok if (!empty($response_data['success']) && $response_data['success'] === true) { $mail = new PHPMailer(true); try { + $mail->SMTPDebug = 0; // Debug-Ausgabe deaktiviert $mail->isSMTP(); $mail->Host = $smtp_config['smtp_host']; $mail->Port = $smtp_config['smtp_port']; @@ -62,17 +69,18 @@ if (!empty($response_data['success']) && $response_data['success'] === true) { $mail->Username = $smtp_config['smtp_username']; $mail->Password = $smtp_config['smtp_password']; $mail->SMTPSecure = $smtp_config['smtp_encryption']; + $mail->CharSet = 'UTF-8'; + $mail->Encoding = 'base64'; + // Absenderadresse prüfen + if (empty($smtp_config['smtp_from'])) { + throw new Exception("Absenderadresse nicht konfiguriert."); + } $mail->setFrom($smtp_config['smtp_from'], $smtp_config['smtp_from_name']); $mail->addAddress('office@amperion.at'); // Empfänger if (!empty($email)) { $mail->addReplyTo($email, $name); } - - // UTF-8 für Betreff und Inhalt erzwingen - $mail->CharSet = 'UTF-8'; // <-- WICHTIG - $mail->Encoding = 'base64'; // <-- WICHTIG - $mail->Subject = mb_encode_mimeheader("Neue Kontaktanfrage: $subject", 'UTF-8'); $mail->Body = " Name: $name @@ -85,13 +93,14 @@ if (!empty($response_data['success']) && $response_data['success'] === true) { "; $mail->send(); - header("Location: /danke/"); // Leitet zu /danke/index.html um + header("Location: /danke/"); exit(); } catch (Exception $e) { - error_log("E-Mail-Fehler: " . $mail->ErrorInfo); + error_log("E-Mail-Fehler: " . $e->getMessage()); echo "

Es gab ein Problem beim Senden der Nachricht. Bitte versuche es später erneut.

"; } } else { error_log("hCaptcha-Überprüfung fehlgeschlagen: " . print_r($response_data, true)); echo "

Bitte bestätige, dass du kein Roboter bist.

"; } +?> diff --git a/themes/airspace-hugo/layouts/_default/baseof.html b/themes/airspace-hugo/layouts/_default/baseof.html index e33e1ca..e21cf44 100644 --- a/themes/airspace-hugo/layouts/_default/baseof.html +++ b/themes/airspace-hugo/layouts/_default/baseof.html @@ -19,6 +19,27 @@ AUTHOR WEBSITE: https://gethugothemes.com {{ else }} {{ partial "style.html" . }} {{ end }} + + + + + + + + + diff --git a/themes/airspace-hugo/layouts/partials/head.html b/themes/airspace-hugo/layouts/partials/head.html index eca144e..ebe6ac3 100644 --- a/themes/airspace-hugo/layouts/partials/head.html +++ b/themes/airspace-hugo/layouts/partials/head.html @@ -147,6 +147,13 @@ {{ end }} {{ end }} + + + + + + + {{ if site.Params.baidu.enable }} {{ with site.Params.baidu.analytics_id }}