]> skyeroc.xyz Git - flatmark/commitdiff
mail-shortcode
authorelektrischerwalfisch <mail@elektrischerwalfisch.de>
Fri, 11 Apr 2025 21:22:57 +0000 (23:22 +0200)
committerelektrischerwalfisch <mail@elektrischerwalfisch.de>
Fri, 11 Apr 2025 21:22:57 +0000 (23:22 +0200)
pages-en/contact.md
theme/mailto.php [new file with mode: 0644]
theme/shortcodes.php

index eb4b5411c5a056f0d43959d440d7afc7541f57de..26024adfecc643f45a4837245c6ff22a02dfe970 100644 (file)
@@ -1,3 +1,5 @@
 # Contact
 
-...
\ No newline at end of file
+You got questions about flatmark or you want me to build a flatMark-website for you?  
+
+Just {mail}contact me!{/mail}
diff --git a/theme/mailto.php b/theme/mailto.php
new file mode 100644 (file)
index 0000000..a3793ce
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+// Build and redirect to the actual mailto link
+$emailUser = "flatmark";
+$emailDomain = "elektrischerwalfisch.de";
+$email = $emailUser . '@' . $emailDomain;
+
+// Redirect to the mail client
+header("Location: mailto:$email");
+exit;
+
+?>
\ No newline at end of file
index 2d1e5c49c6ed21230120c5a77e27507731f9000e..f3ed2e37c976f1ad6f5958a4a5303a1ec87308c3 100644 (file)
@@ -77,8 +77,6 @@
             return '<div class="background ' . $bgClass . '">' . $bgHtml . '</div>';
         }, $markdown);
 
-
-
     // Shortcode: img rounded
         $pattern = '/\{img-rounded\}(.*?)\{\/img-rounded\}/s';
         $markdown = preg_replace_callback($pattern, function ($matches) use ($Parsedown) {
             return '<div class="img-rounded">' . $imgRounded . '</div>';
         }, $markdown);
 
+    // Shortcode: mail link
+        $pattern = '/\{mail\}(.*?)\{\/mail\}/s';
+        $markdown = preg_replace_callback($pattern, function ($matches) {
+            $linkText = trim($matches[1]);
+            return '<a href="../theme/mailto.php">' . htmlspecialchars($linkText) . '</a>';
+        }, $markdown);
+
     // Shortcode: output readme-file
         $pattern = '/\{readme\}/s';
         $markdown = preg_replace_callback($pattern, function () use ($Parsedown) {