| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- /**
- * Contact page — same minimal, centered style as the landing intro.
- * Content (title, text and contact methods) is edited in admin → Contact.
- */
- require __DIR__ . '/app/bootstrap.php';
- $site = site_get();
- $title = $site['contact_title'] ?: 'Get in touch';
- $email = trim((string)($site['contact_email'] ?? ''));
- $phone = trim((string)($site['contact_phone'] ?? ''));
- $insta = trim((string)($site['contact_instagram'] ?? ''));
- /** Turn an Instagram handle or URL into a link + label. */
- $instaLink = null;
- $instaLabel = null;
- if ($insta !== '') {
- if (preg_match('#^https?://#i', $insta)) {
- $instaLink = $insta;
- $instaLabel = preg_replace('#^https?://(www\.)?instagram\.com/#i', '@', rtrim($insta, '/'));
- } else {
- $handle = ltrim($insta, '@');
- $instaLink = 'https://instagram.com/' . rawurlencode($handle);
- $instaLabel = '@' . $handle;
- }
- }
- public_header($title . ' · ' . ($site['intro_title'] ?: config('site.name', '')), 'contact');
- ?>
- <section class="intro contact">
- <h1 class="contact-title"><?= e($title) ?></h1>
- <?php if (trim((string)($site['contact_text'] ?? '')) !== ''): ?>
- <p><?= e($site['contact_text']) ?></p>
- <?php endif; ?>
- <div class="contact-methods">
- <?php if ($email !== ''): ?>
- <a href="mailto:<?= e($email) ?>"><?= e($email) ?></a>
- <?php endif; ?>
- <?php if ($phone !== ''): ?>
- <a href="tel:<?= e(preg_replace('/[^\d+]/', '', $phone)) ?>"><?= e($phone) ?></a>
- <?php endif; ?>
- <?php if ($instaLink !== null): ?>
- <a href="<?= e($instaLink) ?>" target="_blank" rel="noopener noreferrer"><?= e($instaLabel) ?></a>
- <?php endif; ?>
- </div>
- </section>
- <?php public_footer(); ?>
|