Add Contact Page and Update Navigation Links

- Updated navigation links across multiple blog pages to replace "Index" with "Home" and added "Contact" link.
- Created a new contact page with a form for user inquiries.
- Added a new contact template to render the contact page content.
- Updated blog index page to enhance structure and styling.
- Added a contact markdown file for content management.
This commit is contained in:
Keith Solomon
2025-04-21 07:15:03 -05:00
parent 9957a5c116
commit 1a9b58d7d7
21 changed files with 888 additions and 583 deletions

View File

@@ -20,6 +20,8 @@
{{ template "blog_post_content" . }}
{{- else if eq .PageTemplate "category_page" -}}
{{ template "category_content" . }}
{{- else if eq .PageTemplate "contact_page" -}}
{{ template "contact_content" . }}
{{- else -}}
<p>Unknown PageTemplate: {{ .PageTemplate }}</p>
{{- end -}}

View File

@@ -3,12 +3,15 @@
{{ end }}
{{ define "blog_index_content" }}
<h1>Blog Index</h1>
<ul>
{{ range .Posts }}
<li><a href="/blog/{{ .Slug }}/">{{ .Title }}</a><br>{{ .Description }}</li>
{{ else }}
<li>No posts found.</li>
{{ end }}
</ul>
<div class="main">
<h1>Go SSG - Blog Index</h1>
<ul>
{{ range .Posts }}
<li><a href="/blog/{{ .Slug }}/">{{ .Title }}</a><br>{{ .Description }}</li>
{{ else }}
<li>No posts found.</li>
{{ end }}
</ul>
</div>
{{ end }}

View File

@@ -0,0 +1,37 @@
{{ define "contact_page" }}
{{ template "base" . }}
{{ end }}
{{ define "contact_content" }}
<h1 class="text-2xl font-bold mb-4">Contact Me</h1>
<form action="https://api.staticforms.xyz/submit" method="POST" class="space-y-4 max-w-xl">
<!-- StaticForms API Key -->
<input type="hidden" name="accessKey" value="sf_5m86ek16hmele1jlkl62ghml" />
<!-- Optional redirect after success -->
<!-- <input type="hidden" name="redirectTo" value="https://yourdomain.com/thanks/" /> -->
<label class="block">
<span class="block text-sm font-medium">Your Name</span>
<input type="text" name="name" required class="w-full border p-2 rounded" />
</label>
<label class="block">
<span class="block text-sm font-medium">Email Address</span>
<input type="email" name="email" required class="w-full border p-2 rounded" />
</label>
<label class="block">
<span class="block text-sm font-medium">Message</span>
<textarea name="message" rows="5" required class="w-full border p-2 rounded"></textarea>
</label>
<!-- reCAPTCHA if configured in dashboard -->
<!-- <div class="g-recaptcha" data-sitekey="your-recaptcha-site-key"></div> -->
<button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700">
Send Message
</button>
</form>
{{ end }}