From: elektrischerwalfisch Date: Fri, 11 Apr 2025 21:22:57 +0000 (+0200) Subject: mail-shortcode X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=d46fe6e898c09416441f2cbd7b15fc43f89ec348;p=flatmark mail-shortcode --- diff --git a/pages-en/contact.md b/pages-en/contact.md index eb4b541..26024ad 100644 --- a/pages-en/contact.md +++ b/pages-en/contact.md @@ -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 index 0000000..a3793ce --- /dev/null +++ b/theme/mailto.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/theme/shortcodes.php b/theme/shortcodes.php index 2d1e5c4..f3ed2e3 100644 --- a/theme/shortcodes.php +++ b/theme/shortcodes.php @@ -77,8 +77,6 @@ return '
' . $bgHtml . '
'; }, $markdown); - - // Shortcode: img rounded $pattern = '/\{img-rounded\}(.*?)\{\/img-rounded\}/s'; $markdown = preg_replace_callback($pattern, function ($matches) use ($Parsedown) { @@ -87,6 +85,13 @@ return '
' . $imgRounded . '
'; }, $markdown); + // Shortcode: mail link + $pattern = '/\{mail\}(.*?)\{\/mail\}/s'; + $markdown = preg_replace_callback($pattern, function ($matches) { + $linkText = trim($matches[1]); + return '' . htmlspecialchars($linkText) . ''; + }, $markdown); + // Shortcode: output readme-file $pattern = '/\{readme\}/s'; $markdown = preg_replace_callback($pattern, function () use ($Parsedown) {