') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Add info blocks by enatario · Pull Request #14 · RubyGemsOrg/rubycentral-theme · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions about.hbs
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
{{!< default}}
{{> "components/hero" copy="title:'About::Hero - Body'" links="tag:hash-about-hero-link" linksLabel="More in about"}}

{{#> "components/section" id="history" copy="title:'About::History - Heading'"}}
{{/components/section}}

{{> "components/info-block" copy="title:'About::Mission'" primary="title:'About::Mission - Button'" id="mission" container=true inverse=true}}

{{#> "components/section" id="board-of-directors" copy="title:'About::BoardOfDirectors - Heading'"}}
{{/components/section}}

{{#> "components/section" id="staff" copy="title:'About::Staff - Heading'"}}
{{/components/section}}

{{> "components/cta" copy="title:'About::Callout'" primary="title:'About::Callout - Button'" label="Contact"}}
18 changes: 18 additions & 0 deletions custom-community.hbs
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
{{!< default}}
{{> "components/hero" copy="title:'Community::Hero - Body'" links="tag:hash-community-hero-link" linksLabel="More in community"}}

{{#> "components/section" id="membership" copy="title:'Community::Membership - Heading'" grid=true}}
{{> "components/info-block" copy="title:'Community::Membership - Ruby Friend'" primary="title:'Community::Membership - Ruby Friend - Button'" id="" border=true}}
{{> "components/info-block" copy="title:'Community::Membership - CommunitySupporter'" primary="title:'Community::Membership - CommunitySupporter - Button'" id="" border=true}}
{{> "components/info-block" copy="title:'Community::Membership - CommunitySupporterRubyGems'" primary="title:'Community::Membership - CommunitySupporterRubyGems - Button'" id="" border=true}}
{{/components/section}}

{{> "components/cta" copy="title:'Community::Callout - Donate'" primary="title:'Community::Callout - Donate - Button'" label="Donate"}}

{{> "components/info-block" copy="title:'Community::RubyFellows'" primary="title:'Community::RubyFellows - Button'" id="ruby-fellows" container=true}}

{{> "components/info-block" copy="title:'Community::SteeringCommittees'" primary="title:'Community::SteeringCommittees - Button'" id="steering-committees" container=true inverse=true}}

{{#> "components/section" id="volunteering" copy="title:'Community::Volunteering - Heading'" grid=true}}
{{> "components/info-block" copy="title:'Community::Volunteering - AtEvents'" primary="title:'Community::Volunteering - AtEvents - Button'" id=""}}
{{> "components/info-block" copy="title:'Community::Volunteering - InPrograms'" primary="title:'Community::Volunteering - InPrograms - Button'" secondary="title:'Community::Volunteering - InPrograms - Secondary Button'" id=""}}
{{> "components/info-block" copy="title:'Community::Volunteering - InOpenSource'" primary="title:'Community::Volunteering - InOpenSource - Button'" id=""}}
{{/components/section}}

{{> "components/cta" copy="title:'Community::Callout - Code Of Conduct'" primary="title:'Community::Callout - Code Of Conduct - Button'" label="Code of conduct"}}
8 changes: 8 additions & 0 deletions custom-events.hbs
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
{{!< default}}
{{> "components/hero" copy="title:'Events::Hero - Body'" links="tag:hash-events-hero-link" linksLabel="More in events"}}

{{> "components/info-block" copy="title:'Events::RubyConf2026'" primary="title:'Events::RubyConf2026 - Button'" secondary="title:'Events::RubyConf2026 - Secondary Button'" id="rubyconf-2026" container=true}}

{{> "components/cta" copy="title:'Events::Callout'" primary="title:'Events::Callout - Button'" label="Scholars and Guides"}}

{{> "components/info-block" copy="title:'Events::CallForProposals'" primary="title:'Events::CallForProposals - Button'" secondary="title:'Events::CallForProposals - Secondary Button'" id="call-for-proposals" container=true}}

{{> "components/info-block" copy="title:'Events::NearbyEvents'" primary="title:'Events::NearbyEvents - Button'" secondary="title:'Events::NearbyEvents - Secondary Button'" id="nearby-events" container=true inverse=true}}

{{#> "components/section" id="past-events" copy="title:'Events::PastEvents - Heading'"}}
{{> "components/cta-buttons" primary="title:'Events::PastEvents - Button'"}}
{{/components/section}}
8 changes: 4 additions & 4 deletions custom-programs.hbs
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
{{!< default}}
{{> "components/hero" copy="title:'Programs::Hero - Body'" links="tag:hash-programs-hero-link" linksLabel="More in programs"}}

{{> "components/info-block" copy="title:'Programs::RubyGems'" primary="title:'Programs::RubyGems - Button'" secondary="title:'Programs::RubyGems - Secondary Button'" id="rubygems" container=true inverse=true imageClass="bottom-right"}}
{{> "components/info-block" copy="title:'Programs::RubyGems'" primary="title:'Programs::RubyGems - Button'" secondary="title:'Programs::RubyGems - Secondary Button'" id="rubygems" container=true inverse=true}}

{{#> "components/section" id="open-source-projects" copy="title:'Programs::OpenSourceProjects - Heading'" grid=true}}
{{> "components/info-block" copy="title:'Programs::OpenSourceProjects - Bundler'" primary="title:'Programs::OpenSourceProjects - Bundler - Button'" id="" border=true}}
Expand All@@ -13,10 +13,10 @@

{{> "components/cta" copy="title:'Programs::Callout - Ideas'" primary="title:'Programs::Callout - Ideas - Button'" label="Suggest a program"}}

{{> "components/info-block" copy="title:'Programs::ProjectDream'" primary="title:'Programs::ProjectDream - Button'" secondary="title:'Programs::ProjectDream - Secondary Button'" id="project-dream" container=true imageClass="top-left"}}
{{> "components/info-block" copy="title:'Programs::ProjectDream'" primary="title:'Programs::ProjectDream - Button'" secondary="title:'Programs::ProjectDream - Secondary Button'" id="project-dream" container=true}}

{{> "components/info-block" copy="title:'Programs::Apprenticeships'" primary="title:'Programs::Apprenticeships - Button'" id="apprenticeships" container=true inverse=true imageClass="bottom-right"}}
{{> "components/info-block" copy="title:'Programs::Apprenticeships'" primary="title:'Programs::Apprenticeships - Button'" id="apprenticeships" container=true inverse=true}}

{{> "components/cta" copy="title:'Programs::Callout - Get Involved'" primary="title:'Programs::Callout - Get Involved - Button'" label="Get involved"}}

{{> "components/info-block" copy="title:'Programs::InfrastructureAndSecurity'" primary="title:'Programs::InfrastructureAndSecurity - Button'" secondary="title:'Programs::InfrastructureAndSecurity - Secondary Button'" id="infrastructure-and-security" container=true imageClass="top-left"}}
{{> "components/info-block" copy="title:'Programs::InfrastructureAndSecurity'" primary="title:'Programs::InfrastructureAndSecurity - Button'" secondary="title:'Programs::InfrastructureAndSecurity - Secondary Button'" id="infrastructure-and-security" container=true}}
24 changes: 24 additions & 0 deletions custom-sponsors.hbs
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
{{!< default}}
{{> "components/hero" copy="title:'Sponsors::Hero - Body'" links="tag:hash-sponsors-hero-link" linksLabel="More in sponsorship"}}

{{#> "components/section" id="sponsorship-paths" copy="title:'Sponsors::SponsorshipPaths - Heading'" grid=true}}
{{> "components/info-block" copy="title:'Sponsors::SponsorshipPaths - SponsorRubyCentral'" primary="title:'Sponsors::SponsorshipPaths - SponsorRubyCentral - Button'" id="" border=true}}
{{> "components/info-block" copy="title:'Sponsors::SponsorshipPaths - RubyAlliance'" primary="title:'Sponsors::SponsorshipPaths - RubyAlliance - Button'" id="" border=true}}
{{/components/section}}

{{#> "components/section" id="sponsors" copy="title:'Sponsors::CurrentSponsors - Heading'"}}
{{/components/section}}

{{> "components/cta" copy="title:'Sponsors::Callout - Become A Sponsor'" primary="title:'Sponsors::Callout - Become A Sponsor - Button'" secondary="title:'Sponsors::Callout - Become A Sponsor - Secondary Button'" label="Become a sponsor"}}

{{> "components/info-block" copy="title:'Sponsors::RubyAlliance'" primary="title:'Sponsors::RubyAlliance - Button'" id="ruby-alliance" container=true inverse=true}}

{{#> "components/section" id="impact" copy="title:'Sponsors::Impact - Heading'" grid=true}}
{{> "components/info-block" copy="title:'Sponsors::Impact - Infrastructure'" primary="title:'Sponsors::Impact - Infrastructure - Button'" id=""}}
{{> "components/info-block" copy="title:'Sponsors::Impact - Events'" primary="title:'Sponsors::Impact - Events - Button'" id=""}}
{{> "components/info-block" copy="title:'Sponsors::Impact - CommunityPrograms'" primary="title:'Sponsors::Impact - CommunityPrograms - Button'" id=""}}
{{/components/section}}

{{#> "components/section" id="become-a-sponsor" copy="title:'Sponsors::BecomeASponsor - Heading'" grid=true}}
{{> "components/info-block" copy="title:'Sponsors::BecomeASponsor - ChooseYourLevel'" primary="title:'Sponsors::BecomeASponsor - ChooseYourLevel - Button'" id=""}}
{{> "components/info-block" copy="title:'Sponsors::BecomeASponsor - GetInTouch'" primary="title:'Sponsors::BecomeASponsor - GetInTouch - Button'" id=""}}
{{> "components/info-block" copy="title:'Sponsors::BecomeASponsor - GetRecognized'" primary="title:'Sponsors::BecomeASponsor - GetRecognized - Button'" id=""}}
{{/components/section}}

{{> "components/cta" copy="title:'Sponsors::Callout - Explore Programs'" primary="title:'Sponsors::Callout - Explore Programs - Button'" label="Explore programs"}}
17 changes: 16 additions & 1 deletion src/css/components/_info-block.css
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,14 +25,25 @@
padding: var(--space--base);
}

.info-block--inverse .info-block__image {
.info-block__image {
order: -1;

.image {
height: 18rem;
}
}

@container info-block (min-width: 65em) {
.info-block:not(.info-block--inverse) .info-block__image {
order: 1;
}
}

.info-block__content {
display: flex;
flex-direction: column;
gap: var(--space--small);
height: 100%;

h2,
h3,
Expand All@@ -58,6 +69,10 @@
font-weight: var(--font-weight--normal);
line-height: var(--line-height--tight);
}

.cta-buttons {
margin-block-start: auto;
}
}

.info-block__content:has(> h4) {
Expand Down
6 changes: 6 additions & 0 deletions src/css/components/_section.css
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
.section {
display: flex;
flex-direction: column;
gap: var(--space--medium);
}

.section__heading {
display: flex;
flex-direction: column;
Expand Down