Skip to content

Commit 86e8eba

Browse files
www-site: Replace JS date formatting with Pelican + fix hero HTML bugs
1 parent 854ab04 commit 86e8eba

File tree

1 file changed

+34
-31
lines changed

1 file changed

+34
-31
lines changed

content/index.ezmd

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ bodytag: id="home"
1010
<p><a href="/projects/" class="btn">See Projects</a></p>
1111
</div>
1212
<div class="w33 relative scrolling-logos">
13-
<div id="para-1" class="home-hero-parallax"">
14-
<img class="object-fit-contain" loading="lazy" src src="https://www.apache.org[{featured_projs[0].logo}]" alt="Logo">
13+
<div id="para-1" class="home-hero-parallax">
14+
<img class="object-fit-contain" loading="lazy" src="https://www.apache.org[{featured_projs[0].logo}]" alt="Logo">
1515
</div>
1616
<div id="para-2" class="home-hero-parallax">
1717
<img class="object-fit-contain" loading="lazy" src="https://www.apache.org[{featured_projs[1].logo}]" alt="Logo">
@@ -34,7 +34,7 @@ bodytag: id="home"
3434
<div id="para-8" class="home-hero-parallax pad-0">
3535
<img class="object-fit-contain" loading="lazy" src="images/parallax-7.webp" alt="Logo">
3636
</div>
37-
</img>
37+
</div>
3838
</div>
3939
</section>
4040
<p class="hidden">
@@ -317,61 +317,64 @@ bodytag: id="home"
317317
</p>
318318
</section>
319319
<section id="plus-one" class="grad-purple">
320-
<script>
321-
// Formats the date provided by the blog feed to the desired format
322-
function formatDate(dateString) {
323-
const date = new Date(dateString);
324-
const options = {
325-
year: 'numeric',
326-
month: 'long',
327-
day: 'numeric'
328-
};
329-
return date.toLocaleDateString('en-US', options);
330-
}
331-
</script>
332320
<div class="inner text-center py-xl">
333321
<div class="text-col mb-large">
334322
<h2 class="text-white">ASF Plus One</h2>
335323
<p class="text-white">Explore what’s new at The ASF — from project news to community voices, all in one place.</p>
336324
</div>
325+
337326
<h3 class="text-white">Most Recent Blog Posts</h3>
338327
<div class="blog-feed flex mb-large flex-column-600">
339-
[for foundation]<div class="blog-card text-left">
328+
{% for foundation in foundation|slice:":3" %}
329+
<div class="blog-card text-left">
340330
<div class="blog-card-inner">
341-
<img class="card-decoration" src="/images/oakleaf.svg" alt="asf oak leaf logo">
342-
<div class="blog-date"><script>document.write(formatDate('[foundation.date]'));</script></div>
343-
<h4>[format "raw"][foundation.title][end]</h4>
331+
<img class="card-decoration" src="/images/oakleaf.svg" alt="asf oak leaf logo">
332+
<div class="blog-date">
333+
{{ foundation.date|strftime('%d %B %Y') }}
334+
</div>
335+
<h4>{{ foundation.title|striptags }}</h4>
344336
<div class="blog-card-link">
345-
<a class="continue" target="_blank" href="[foundation.href]">Read Post</a>
337+
<a class="continue" target="_blank" href="{{ foundation.href }}">Read Post</a>
346338
</div>
347339
</div>
348-
</div>[end]
340+
</div>
341+
{% endfor %}
349342
</div>
343+
350344
<h3 class="text-white">Plus One Newsletter</h3>
351345
<div class="blog-feed flex flex-column-600 mb-large">
352-
[for newsletter]<div class="blog-card text-left">
346+
{% for newsletter in newsletter|slice:":3" %}
347+
<div class="blog-card text-left">
353348
<div class="blog-card-inner">
354349
<img class="card-decoration" src="/images/oakleaf.svg" alt="asf oak leaf logo">
355-
<div class="blog-date"><script>document.write(formatDate('[newsletter.date]'));</script></div>
356-
<h4>[format "raw"][newsletter.title][end]</h4>
350+
<div class="blog-date">
351+
{{ newsletter.date|strftime('%d %B %Y') }}
352+
</div>
353+
<h4>{{ newsletter.title|striptags }}</h4>
357354
<div class="blog-card-link">
358-
<a class="continue" target="_blank" href="[newsletter.href]">Read Post</a>
355+
<a class="continue" target="_blank" href="{{ newsletter.href }}">Read Post</a>
359356
</div>
360357
</div>
361-
</div>[end]
358+
</div>
359+
{% endfor %}
362360
</div>
361+
363362
<h3 class="text-white">Plus One Podcast</h3>
364363
<div class="blog-feed flex flex-column-600">
365-
[for podcast]<div class="blog-card text-left">
364+
{% for podcast in podcast|slice:":3" %}
365+
<div class="blog-card text-left">
366366
<div class="blog-card-inner">
367367
<img class="card-decoration" src="/images/oakleaf.svg" alt="asf oak leaf logo">
368-
<div class="blog-date"><script>document.write(formatDate('[podcast.date]'));</script></div>
369-
<h4>[format "raw"][podcast.title][end]</h4>
368+
<div class="blog-date">
369+
{{ podcast.date|strftime('%d %B %Y') }}
370+
</div>
371+
<h4>{{ podcast.title|striptags }}</h4>
370372
<div class="blog-card-link">
371-
<a class="continue" target="_blank" href="[podcast.href]">Listen Now</a>
373+
<a class="continue" target="_blank" href="{{ podcast.href }}">Listen Now</a>
372374
</div>
373375
</div>
374-
</div>[end]
376+
</div>
377+
{% endfor %}
375378
</div>
376379
</div>
377380
</section>

0 commit comments

Comments
 (0)