Skip to content
Snippets Groups Projects
Commit 755c0f8e authored by Christopher Guindon's avatar Christopher Guindon
Browse files

Merge branch 'recover-commits' into 'main'

fix: Recover commits lost to rebase

See merge request !106
parents 9b4f9846 340faa71
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
title: Blogs and Videos title: Blogs and Videos
hide_page_title: true hide_page_title: true
hide_sidebar: true hide_sidebar: true
container: container-fluid container: container-fluid blogs-and-videos
page_css_file: /public/css/blogs-and-videos.css page_css_file: /public/css/blogs-and-videos.css
--- ---
......
--- ---
title: eclipse.org title: eclipse.org
headline: > headline: >
The Community for <span class="white">Open Innovation</span> The Community for <span class="white">Open Collaboration</span>
<br class="visible-md visible-lg"> and Collaboration <br class="visible-md visible-lg"> and Innovation
tagline: The Eclipse Foundation provides our global community of individuals and tagline: The Eclipse Foundation provides our global community of individuals and
organizations with a mature, scalable, and business-friendly environment for organizations with a mature, scalable, and business-friendly environment for
open source software collaboration and innovation. open source software collaboration and innovation.
......
...@@ -13,10 +13,12 @@ ...@@ -13,10 +13,12 @@
*/ */
import 'eclipsefdn-solstice-assets/js/astro'; import 'eclipsefdn-solstice-assets/js/astro';
import './src/eclipsefdn-promo-content'
import './src/blogs-and-videos';
import eclipsefdnFeaturedProjectCommitter from './src/featured-projects-committer'; import eclipsefdnFeaturedProjectCommitter from './src/featured-projects-committer';
import './src/collaborations/eclipsefdn.rollover-link';
import './src/collaborations/eclipsefdn.weighted-working-groups'; import './src/collaborations/eclipsefdn.weighted-working-groups';
import './src/eclipsefdn-promo-content'
import './src/research/projects-section'; import './src/research/projects-section';
import './src/collaborations/eclipsefdn.rollover-link';
eclipsefdnFeaturedProjectCommitter.render(); eclipsefdnFeaturedProjectCommitter.render();
/**
* Format the blog posts in the blog list.
*
* @param {Element} blogListElement - The blog list element.
*/
const formatPosts = (blogListElement) => {
const daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
const months = [
'January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December'
];
const postElements = blogListElement.querySelectorAll('.post');
postElements.forEach((postElement) => {
const titleElement = postElement.querySelector('.post-head-title');
const subtitleElement = postElement.querySelector('.post-head-subtitle');
let title = titleElement.innerText;
let subtitle = subtitleElement.innerText;
const originalDate = new Date(subtitle);
// Remove author from title
let author = title.substring(0, title.indexOf(': '));
title = title.substring(title.indexOf(': ') + 1).trim();
// Date format conversion
const dayOfWeek = daysOfWeek[originalDate.getDay()];
const month = months[originalDate.getMonth()];
const day = originalDate.getDate();
const year = originalDate.getFullYear();
const formattedDate = `${dayOfWeek}, ${month} ${day}, ${year}`;
// Update subtitle with formatted date and author
subtitle = `${formattedDate} \u2014 by ${author}`;
// Update the text nodes
titleElement.innerText = title;
subtitleElement.innerText = subtitle;
});
}
/**
* Format the blog posts once the blog list has been populated.
*/
const formatPostsOnLoad = () => {
// Constrain the scope of this script to the .blogs-and-videos container class.
const blogListElement = document.querySelector('.blogs-and-videos .solstice-rss-blog-list');
if (!blogListElement) {
return;
}
// Observe the blog list for changes. If children are added, we can assume
// the blog list has been populated or the loading spinner appeared.
const observeBlogList = (mutationList, observer) => {
mutationList.forEach((mutation) => {
if (mutation.type === 'childList') {
// If the blog list is still loading, do nothing.
if (blogListElement.querySelector('.solstice-loading')) {
return;
}
// Stop observing the blog list once it's populated. Format the posts.
observer.disconnect();
formatPosts(blogListElement);
}
});
};
const observer = new MutationObserver(observeBlogList);
observer.observe(blogListElement, { childList: true });
}
formatPostsOnLoad();
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<h1 class="text-center">Blogs and Videos</h1> <h1 class="text-center">Blogs and Videos</h1>
</div> </div>
<section class="row bg-neutral padding-top-60 padding-bottom-40"> <section class="row bg-neutral-flat padding-top-60 padding-bottom-40">
<div class="container"> <div class="container">
<h2 class="margin-bottom-40 text-center" id="eclipse-foundation-team">From Eclipse Foundation Team</h2> <h2 class="margin-bottom-40 text-center" id="eclipse-foundation-team">From Eclipse Foundation Team</h2>
<div class="rss-blog-list"> <div class="rss-blog-list">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment