113 lines
No EOL
3.7 KiB
HTML
113 lines
No EOL
3.7 KiB
HTML
{{ define "main" }}
|
|
<div class="content-wrapper">
|
|
{{ .Content }}
|
|
</div>
|
|
|
|
<style>
|
|
.content-wrapper h2 {
|
|
color: #f7931a;
|
|
font-size: 2rem;
|
|
margin: 2rem 0 1rem;
|
|
text-align: center;
|
|
}
|
|
|
|
.content-wrapper .card h3 {
|
|
color: #f7931a;
|
|
font-size: 1.25rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.content-wrapper .card p {
|
|
font-size: 1.1rem;
|
|
color: #ccc;
|
|
text-align: center;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.content-wrapper .card strong {
|
|
color: #fff;
|
|
}
|
|
|
|
.content-wrapper .card {
|
|
background: #111;
|
|
padding: 2rem;
|
|
border-radius: 10px;
|
|
box-shadow: 0 2px 10px rgba(255,255,255,0.1);
|
|
text-align: center;
|
|
margin: 2rem auto;
|
|
max-width: 400px;
|
|
}
|
|
|
|
.content-wrapper .btn {
|
|
display: inline-block;
|
|
background: white;
|
|
color: #f7931a;
|
|
padding: 1rem 2rem;
|
|
text-decoration: none;
|
|
border-radius: 5px;
|
|
font-weight: 600;
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
.content-wrapper .btn:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const content = document.querySelector('.content-wrapper');
|
|
const html = content.innerHTML;
|
|
|
|
// Transform markdown-rendered content into card structure
|
|
let newHtml = '';
|
|
|
|
// Get first paragraph as About card
|
|
const firstP = html.match(/<p[^>]*>(.*?)<\/p>/);
|
|
if (firstP) {
|
|
newHtml += '<div class="card">' + firstP[0] + '</div>';
|
|
}
|
|
|
|
// Process What We Do section
|
|
const meetupInfo = html.match(/<h2[^>]*id="meetup-info"[^>]*>.*?<\/h2>(.*?)(?=<h2|$)/s);
|
|
if (meetupInfo) {
|
|
newHtml += '<h2 id="meetup-info">What We Do</h2>';
|
|
const cards = meetupInfo[1].match(/<h3[^>]*>.*?<\/h3>\s*<p[^>]*>.*?<\/p>/gs);
|
|
if (cards) {
|
|
cards.forEach(card => {
|
|
newHtml += '<div class="card">' + card + '</div>';
|
|
});
|
|
}
|
|
}
|
|
|
|
// Process Get Involved section
|
|
const getInvolved = html.match(/<h2[^>]*id="get-involved"[^>]*>.*?<\/h2>(.*?)(?=<h2|$)/s);
|
|
if (getInvolved) {
|
|
newHtml += '<h2 id="get-involved">Get Involved</h2>';
|
|
const cards = getInvolved[1].match(/<h3[^>]*>.*?<\/h3>\s*<p[^>]*>.*?<\/p>/gs);
|
|
if (cards) {
|
|
cards.forEach(card => {
|
|
newHtml += '<div class="card">' + card + '</div>';
|
|
});
|
|
}
|
|
}
|
|
|
|
// Process Questionnaire section
|
|
const questionnaire = html.match(/<h2[^>]*id="we-want-to-hear-from-you"[^>]*>.*?<\/h2>(.*?)(?=<\/div>|$)/s);
|
|
if (questionnaire) {
|
|
newHtml += '<h2 id="we-want-to-hear-from-you">We Want To Hear From You!</h2>';
|
|
const card = questionnaire[1].match(/<h3[^>]*>.*?<\/h3>\s*<p[^>]*>.*?<\/p>(\s*<p[^>]*>.*?<\/p>)?/s);
|
|
if (card) {
|
|
// Convert link to button
|
|
let cardHtml = card[0];
|
|
cardHtml = cardHtml.replace(/<a[^>]*href="([^"]*)"[^>]*>([^<]*)<\/a>/g, '<a href="$1" class="btn">$2</a>');
|
|
newHtml += '<div class="card">' + cardHtml + '</div>';
|
|
}
|
|
}
|
|
|
|
content.innerHTML = newHtml;
|
|
});
|
|
</script>
|
|
{{ end }} |