Skip to content
Open
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
101 changes: 101 additions & 0 deletions assets/js/sigs-filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
document.addEventListener('DOMContentLoaded', function() {
const searchInput = document.getElementById('sigSearchInput');
const dayFilter = document.getElementById('dayFilter');
const cardWrappers = document.querySelectorAll('.sig-card-wrapper');
const topicTags = document.querySelectorAll('.topic-tag');
const clearBtn = document.getElementById('clearFilters');

function applyFilters() {
const searchTerm = searchInput ? searchInput.value.toLowerCase().trim() : '';
const dayTerm = dayFilter ? dayFilter.value.toLowerCase() : '';

if (clearBtn) {
if (searchTerm !== '' || dayTerm !== '') {
clearBtn.classList.remove('d-none');
} else {
clearBtn.classList.add('d-none');
}
}

cardWrappers.forEach(wrapper => {
const name = wrapper.dataset.name || '';
const desc = wrapper.dataset.description || '';
const label = wrapper.dataset.label || '';
const days = wrapper.dataset.days || '';

const matchesSearch = name.includes(searchTerm) || desc.includes(searchTerm) || label.includes(searchTerm);
const matchesDay = dayTerm === '' || days.includes(dayTerm);

if (matchesSearch && matchesDay) {
wrapper.classList.remove('d-none');
} else {
wrapper.classList.add('d-none');
}
});

// Update active state of tags
topicTags.forEach(tag => {
if (searchTerm === tag.dataset.tag) {
tag.classList.add('active');
} else {
tag.classList.remove('active');
}
});
}

if(searchInput) searchInput.addEventListener('input', applyFilters);
if(dayFilter) dayFilter.addEventListener('change', applyFilters);

topicTags.forEach(tag => {
tag.addEventListener('click', () => {
if(searchInput) {
searchInput.value = tag.dataset.tag;
applyFilters();
}
});
});

if(clearBtn) {
clearBtn.addEventListener('click', () => {
if(searchInput) searchInput.value = '';
if(dayFilter) dayFilter.value = '';
applyFilters();
});
}

// Handle URL hash for tab activation
if (window.location.hash) {
const hash = window.location.hash;
const tabEl = document.querySelector(`button[data-bs-target="${hash}"]`);
if (tabEl) {
// Check if bootstrap is available
if (typeof bootstrap !== 'undefined') {
const tab = new bootstrap.Tab(tabEl);
tab.show();
}
}
}

// Handle Expand/Collapse toggle text and icons
const collapsibles = document.querySelectorAll('.collapse');
collapsibles.forEach(coll => {
coll.addEventListener('show.bs.collapse', function (e) {
const btn = document.querySelector(`[data-bs-target="#${e.target.id}"]`);
if(btn) {
const icon = btn.querySelector('.toggle-icon');
const text = btn.querySelector('.toggle-text');
if(icon) { icon.classList.remove('fa-chevron-down'); icon.classList.add('fa-chevron-up'); }
if(text) { text.textContent = 'Hide Details'; }
}
});
coll.addEventListener('hide.bs.collapse', function (e) {
const btn = document.querySelector(`[data-bs-target="#${e.target.id}"]`);
if(btn) {
const icon = btn.querySelector('.toggle-icon');
const text = btn.querySelector('.toggle-text');
if(icon) { icon.classList.remove('fa-chevron-up'); icon.classList.add('fa-chevron-down'); }
if(text) { text.textContent = 'Show Details'; }
}
});
});
});
12 changes: 12 additions & 0 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,15 @@ body.td-home div.lead p {
max-width: 600px;
}
}

/* Community Groups Topic Tags */
.topic-tag {
background-color: rgba(var(--bs-primary-rgb), 0.1);
color: var(--bs-primary);
transition: all 0.2s ease;

&.active {
background-color: var(--bs-primary);
color: #fff;
}
}
8 changes: 8 additions & 0 deletions assets/scss/sigs-list.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* Custom styles for sigs-list shortcode */

@media (max-width: 767.98px) {
.sigs-sticky-header {
top: 0 !important;
padding-top: 0.5rem !important;
}
}
1 change: 0 additions & 1 deletion content/en/community/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
code-of-conduct-incident-process.md
community-groups.md
community-meeting.md
mentoring.md
values.md
244 changes: 244 additions & 0 deletions content/en/community/community-groups/_content.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
{{/* content/en/community/community-groups/_content.gotmpl */}}

{{ $defaultBranch := "main" }}
{{ $sigsUrl := printf "https://raw.githubusercontent.com/kubernetes/community/%s/sigs.yaml" $defaultBranch }}
{{ $rawBaseUrl := printf "https://raw.githubusercontent.com/kubernetes/community/%s/" $defaultBranch }}
{{ $githubBaseUrl := printf "https://github.com/kubernetes/community/tree/%s/" $defaultBranch }}

{{/* Global Options for GetRemote */}}
{{- $globalOpts := dict -}}
{{- with os.Getenv "HUGO_GITHUB_TOKEN" -}}
{{- $globalOpts = dict "headers" (dict "Authorization" (printf "Bearer %s" .)) -}}
{{- end -}}

{{- $sigsOpts := merge $globalOpts (dict "key" "sigs-yaml-adapter") -}}

{{ with resources.GetRemote $sigsUrl $sigsOpts }}
{{ with .Err }}
{{ if eq hugo.Environment "production" }}
{{ errorf "Unable to load sigs.yaml: %s" . }}
{{ else }}
{{ warnf "Unable to load sigs.yaml: %s" . }}
{{ end }}
{{ end }}

{{ with .Content | transform.Unmarshal }}
{{/* SIGs */}}
{{ range .sigs }}
{{ $name := .name }}
{{ $dir := .dir }}
{{ $slug := replace $dir "sig-" "" }}

{{/* Fetch README Content */}}
{{ $readmeUrl := printf "%s%s/README.md" $rawBaseUrl $dir }}
{{ $readmeContent := "" }}
{{ $readmeOpts := merge $globalOpts (dict "key" (printf "readme-%s" $dir)) }}
{{ with resources.GetRemote $readmeUrl $readmeOpts }}
{{ if .Err }}
{{ if eq hugo.Environment "production" }}
{{ errorf "Unable to load README for %s: %s" $dir .Err }}
{{ else }}
{{ warnf "Unable to load README for %s: %s" $dir .Err }}
{{ end }}
{{ else }}
{{ $readmeContent = replace .Content "\u200b" "" }}
{{ end }}
{{ end }}

{{ $page := dict
"kind" "section"
"path" (printf "sigs/%s" $slug)
"title" (printf "SIG %s" $name)
"params" (dict
"description" .mission_statement
"leadership" .leadership
"meetings" .meetings
"contact" .contact
"subprojects" .subprojects
"label" .label
"dir" .dir
"remote_readme_url" (printf "%s%s/README.md" $githubBaseUrl $dir)
"remote_charter_url" (printf "%s%s/charter.md" $githubBaseUrl $dir)
)
"content" (dict
"mediaType" "text/markdown"
"value" $readmeContent
)
}}
{{ $.AddPage $page }}

{{/* Fetch Charter Content */}}
{{ $charterUrl := printf "%s%s/charter.md" $rawBaseUrl $dir }}
{{ $charterOpts := merge $globalOpts (dict "key" (printf "charter-%s" $dir)) }}
{{ with resources.GetRemote $charterUrl $charterOpts }}
{{ if .Err }}
{{ if eq hugo.Environment "production" }}
{{ errorf "Unable to load charter for %s: %s" $dir .Err }}
{{ else }}
{{ warnf "Unable to load charter for %s: %s" $dir .Err }}
{{ end }}
{{ else }}
{{ $charterContent := replace .Content "\u200b" "" }}
{{ $charterPage := dict
"kind" "page"
"path" (printf "sigs/%s/charter" $slug)
"title" (printf "SIG %s Charter" $name)
"params" (dict
"remote_charter_url" (printf "%s%s/charter.md" $githubBaseUrl $dir)
"hide_summary" true
"toc_hide" true
)
"content" (dict "mediaType" "text/markdown"
"value" $charterContent
)
}}
{{ $.AddPage $charterPage }}
{{ end }}
{{ end }}
{{ end }}

{{/* Working Groups */}}
{{ range .workinggroups }}
{{ $name := .name }}
{{ $dir := .dir }}
{{ $slug := replace $dir "wg-" "" }}

{{/* Fetch README Content */}}
{{ $readmeUrl := printf "%s%s/README.md" $rawBaseUrl $dir }}
{{ $readmeContent := "" }}
{{ $readmeOpts := merge $globalOpts (dict "key" (printf "readme-%s" $dir)) }}
{{ with resources.GetRemote $readmeUrl $readmeOpts }}
{{ if .Err }}
{{ if eq hugo.Environment "production" }}
{{ errorf "Unable to load README for %s: %s" $dir .Err }}
{{ else }}
{{ warnf "Unable to load README for %s: %s" $dir .Err }}
{{ end }}
{{ else }}
{{ $readmeContent = replace .Content "\u200b" "" }}
{{ end }}
{{ end }}

{{ $page := dict
"kind" "section"
"path" (printf "wg/%s" $slug)
"title" (printf "WG %s" $name)
"params" (dict
"description" .mission_statement
"leadership" .leadership
"meetings" .meetings
"contact" .contact
"dir" .dir
"remote_readme_url" (printf "%s%s/README.md" $githubBaseUrl $dir)
"remote_charter_url" (printf "%s%s/charter.md" $githubBaseUrl $dir)
)
"content" (dict
"mediaType" "text/markdown"
"value" $readmeContent
)
}}
{{ $.AddPage $page }}

{{/* Fetch Charter Content */}}
{{ $charterUrl := printf "%s%s/charter.md" $rawBaseUrl $dir }}
{{ $charterOpts := merge $globalOpts (dict "key" (printf "charter-%s" $dir)) }}
{{ with resources.GetRemote $charterUrl $charterOpts }}
{{ if .Err }}
{{ if eq hugo.Environment "production" }}
{{ errorf "Unable to load charter for %s: %s" $dir .Err }}
{{ else }}
{{ warnf "Unable to load charter for %s: %s" $dir .Err }}
{{ end }}
{{ else }}
{{ $charterContent := replace .Content "\u200b" "" }}
{{ $charterPage := dict
"kind" "page"
"path" (printf "wg/%s/charter" $slug)
"title" (printf "WG %s Charter" $name)
"params" (dict
"remote_charter_url" (printf "%s%s/charter.md" $githubBaseUrl $dir)
"hide_summary" true
"toc_hide" true
)
"content" (dict "mediaType" "text/markdown"
"value" $charterContent
)
}}
{{ $.AddPage $charterPage }}
{{ end }}
{{ end }}
{{ end }}

{{/* Committees */}}
{{ range .committees }}
{{ $name := .name }}
{{ $dir := .dir }}
{{ $slug := replace $dir "committee-" "" }}

{{/* Fetch README Content */}}
{{ $readmeUrl := printf "%s%s/README.md" $rawBaseUrl $dir }}
{{ $readmeContent := "" }}
{{ $readmeOpts := merge $globalOpts (dict "key" (printf "readme-%s" $dir)) }}
{{ with resources.GetRemote $readmeUrl $readmeOpts }}
{{ if .Err }}
{{ if eq hugo.Environment "production" }}
{{ errorf "Unable to load README for %s: %s" $dir .Err }}
{{ else }}
{{ warnf "Unable to load README for %s: %s" $dir .Err }}
{{ end }}
{{ else }}
{{ $readmeContent = replace .Content "\u200b" "" }}
{{ end }}
{{ end }}

{{ $page := dict
"kind" "section"
"path" (printf "committees/%s" $slug)
"title" (printf "%s" $name)
"params" (dict
"description" .mission_statement
"leadership" .leadership
"meetings" .meetings
"contact" .contact
"dir" .dir
"remote_readme_url" (printf "%s%s/README.md" $githubBaseUrl $dir)
"remote_charter_url" (printf "%s%s/charter.md" $githubBaseUrl $dir)
)
"content" (dict
"mediaType" "text/markdown"
"value" $readmeContent
)
}}
{{ $.AddPage $page }}

{{/* Fetch Charter Content */}}
{{ $charterUrl := printf "%s%s/charter.md" $rawBaseUrl $dir }}
{{ $charterOpts := merge $globalOpts (dict "key" (printf "charter-%s" $dir)) }}
{{ with resources.GetRemote $charterUrl $charterOpts }}
{{ if .Err }}
{{ if eq hugo.Environment "production" }}
{{ errorf "Unable to load charter for %s: %s" $dir .Err }}
{{ else }}
{{ warnf "Unable to load charter for %s: %s" $dir .Err }}
{{ end }}
{{ else }}
{{ $charterContent := replace .Content "\u200b" "" }}
{{ $charterPage := dict
"kind" "page"
"path" (printf "committees/%s/charter" $slug)
"title" (printf "%s Charter" $name)
"params" (dict
"remote_charter_url" (printf "%s%s/charter.md" $githubBaseUrl $dir)
"hide_summary" true
"toc_hide" true
)
"content" (dict "mediaType" "text/markdown"
"value" $charterContent
)
}}
{{ $.AddPage $charterPage }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
Loading