Skip to content

Render community groups info using content adapter#654

Merged
k8s-ci-robot merged 14 commits intokubernetes:masterfrom
TineoC:improve-sigs-layout
Mar 27, 2026
Merged

Render community groups info using content adapter#654
k8s-ci-robot merged 14 commits intokubernetes:masterfrom
TineoC:improve-sigs-layout

Conversation

@TineoC
Copy link
Copy Markdown
Contributor

@TineoC TineoC commented Feb 13, 2026

This PR modernizes the community groups section by implementing Hugo Content Adapters and a new responsive grid layout.

Key Changes:

  • Hugo Content Adapters: Replaced fragile bash-based generation with dynamic, in-build page creation for SIGs, WGs, and Committees.
  • Dynamic Content: READMEs and Charters are now fetched directly from the kubernetes/community repo during the Hugo build.
  • Grid Layout: Implemented a modern, responsive grid component for the community groups index with improved search and filtering.
  • Cleanup: Removed legacy User Groups and deleted obsolete static markdown files.

Netlify Configuration (Required for Production):
This PR introduces authenticated remote resource fetching to prevent GitHub API rate limiting during site builds.
An environment variable named HUGO_GITHUB_TOKEN must be added to the Netlify site settings.

  • Token Scope: A fine-grained Personal Access Token (PAT) with read-only access to public repositories is recommended.
  • Fallback: The build will still attempt to fetch resources without a token (unauthenticated) if the variable is missing, but it may fail due to rate limits in high-traffic CI environments.

Fixes: #653

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. labels Feb 13, 2026
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 13, 2026
@TineoC TineoC changed the title feat: improve SIGs and community groups directory layout feat: improve SIGs and community groups layout Feb 13, 2026
@TineoC
Copy link
Copy Markdown
Contributor Author

TineoC commented Feb 13, 2026

While this is a nice feature to add, it significantly adds to our build times, especially at the gen-content step. We could wait till this is merged so we can add these changes after.

@TineoC TineoC closed this Feb 13, 2026
@TineoC TineoC reopened this Feb 15, 2026
@TineoC
Copy link
Copy Markdown
Contributor Author

TineoC commented Feb 15, 2026

/hold /label draft

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 15, 2026
@TineoC
Copy link
Copy Markdown
Contributor Author

TineoC commented Feb 15, 2026

image

I would like to hear your thoughts on this idea @kaslin @chris-short

@TineoC
Copy link
Copy Markdown
Contributor Author

TineoC commented Feb 20, 2026

/remove-hold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 20, 2026
@lmktfy
Copy link
Copy Markdown
Member

lmktfy commented Feb 21, 2026

If you didn't also consider a content adapter to render one page per SIG, then bear in mind that that is also an option.

I quite like the two-column layout, though.

@TineoC
Copy link
Copy Markdown
Contributor Author

TineoC commented Feb 21, 2026

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 21, 2026
TineoC added a commit to TineoC/contributor-site that referenced this pull request Mar 22, 2026
@TineoC TineoC changed the title feat: improve SIGs and community groups layout feat(sigs): dynamic grid layout and content adapters modernization Mar 22, 2026
@TineoC TineoC force-pushed the improve-sigs-layout branch from 02785dc to 9d392a0 Compare March 22, 2026 16:57
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 22, 2026
@TineoC TineoC force-pushed the improve-sigs-layout branch from 9d392a0 to 49296d4 Compare March 22, 2026 17:00
@TineoC TineoC force-pushed the improve-sigs-layout branch from 49296d4 to 3b3b615 Compare March 22, 2026 17:01
@TineoC
Copy link
Copy Markdown
Contributor Author

TineoC commented Mar 22, 2026

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 22, 2026
Copy link
Copy Markdown
Member

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It's impressive.

I can spot a lot of minor problems, but actually the main thing that gets in the way of adding LGTM is the mobile-viewport rendering.

See this video to illustrate what is wrong:
Scroll behavior

I think we should improve that before we merge. The other nits and minor feedback, you can fix if you feel you'd like to. I recommend fixing at least the alias clash.

.gitignore Outdated
Comment on lines +46 to +47
# Ingested documents
data/sigs.yaml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? I think it no longer is.

mentoring.md
values.md
sigs.yaml
community-groups/**
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this ignore?

<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end -}}

<link rel="canonical" href="{{ .Permalink }}">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, could it go in layouts/partials/hooks/head-end.html instead? That's the usual home for custom additions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

This is for SEO to make sure that no matter the version of the sub-page they're visiting, for the search engine, it is the same content.

So it doesn't treat these like different pages, like for example:

1. https://contributor.kubernetes.io/blog/my-post/ (The "official" URL)
2. https://contributor.kubernetes.io/blog/my-post (No trailing slash)
3. http://contributor.kubernetes.io/blog/my-post/ (Insecure version)
4. https://contributor.kubernetes.io/blog/my-post/?utm_source=twitter (With
      tracking parameters)

It would look like: <link rel="canonical" href="https://contributor.kubernetes.io/blog/my-post/">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this overwrite the canonicalUrl defined in blog posts' front matter, where k8s.io or etcd.io is the canonical? My testing shows this breaks that. I ask because I'd like this to be future-proof. We may want something more flexible, like:

  <link rel="canonical" href="{{ with .Params.canonicalURL }}{{ . }}{{ else }}{{ .Permalink }}{{ end }}">

FWIW, k8s.io is using this currently, which would also work:

    {{ with .Params.canonicalUrl }}
    <link rel="canonical" href="{{ . }}">
    {{ end }}

Copy link
Copy Markdown
Contributor Author

@TineoC TineoC Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c92cbea This should allow to override those params

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be working as desired. Thank you, @TineoC!

{{/* layouts/shortcodes/sigs-list.html */}}

{{- $showOnly := .Get "show_only" | default "all" -}}
{{- $sigsUrl := "https://raw.githubusercontent.com/kubernetes/community/master/sigs.yaml" -}}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we might want to give a GitHub token to Netlify to ensure that production builds are authenticated and aren't rate limited.

</div>
</div>

<script>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd put this script inside assets/js and load it at site build time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(can use layouts/partials/hooks/head-end.html for that, if we want)

Want to load a script conditionally? .HasShortcode helps.

<h5 class="fw-bold mb-0 text-primary h6">
<a href="/community/community-groups/wg/{{ .dir | replaceRE "^sig-" "" | replaceRE "^wg-" "" }}/" class="text-decoration-none text-primary">WG {{ .name }}</a>
</h5>
<a href="https://github.com/kubernetes/community/tree/master/{{ .dir }}" class="text-muted" title="View Source"><i class="fab fa-github"></i></a>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extract the name of the default branch, master, to a variable at the top of this shortcode file.

<h5 class="fw-bold mb-0 text-primary h6">
<a href="/community/community-groups/committees/{{ .dir | replaceRE "^sig-" "" | replaceRE "^committee-" "" }}/" class="text-decoration-none text-primary">{{ .name }}</a>
</h5>
<a href="https://github.com/kubernetes/community/tree/master/{{ .dir }}" class="text-muted" title="View Source"><i class="fab fa-github"></i></a>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extract the name of the default branch, master, to a variable at the top of this shortcode file.

@@ -0,0 +1,168 @@
{{/* content/en/community/community-groups/_content.gotmpl */}}

{{ $sigsUrl := "https://raw.githubusercontent.com/kubernetes/community/master/sigs.yaml" }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extract the name of the default branch, master, to a separate variable.

Comment on lines +392 to +395
tag.classList.replace('text-primary', 'text-white');
} else {
tag.classList.replace('bg-opacity-100', 'bg-opacity-10');
tag.classList.replace('text-white', 'text-primary');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: avoid using presentation classes in this kind of script; it means that if we ever add dark mode, we need some basic JavaScript skills in the mix,

A list of our community groups: Special Interest Groups, Working Groups and Committees.
weight: 99
type: docs
aliases: [ "/groups", "/sigs" ]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clashes with aliases: [ "/sigs" ] for content/en/community/community-groups/sigs/_index.md

Avoid having two different pages that both say that a different URL is an alias for themselves.

Copy link
Copy Markdown
Contributor Author

@TineoC TineoC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting review...

@TineoC
Copy link
Copy Markdown
Contributor Author

TineoC commented Mar 23, 2026

Thanks! It's impressive.

I can spot a lot of minor problems, but actually the main thing that gets in the way of adding LGTM is the mobile-viewport rendering.

See this video to illustrate what is wrong: Scroll behavior

I think we should improve that before we merge. The other nits and minor feedback, you can fix if you feel you'd like to. I recommend fixing at least the alias clash.

Thank you.

Please re-attach this video, is giving me 404

TineoC added 3 commits March 23, 2026 18:13
*   Resolve duplicate '/sigs' alias conflict.
*   Optimize build performance by linking to READMEs/Charters on GitHub instead of remote fetching.
*   Implement custom layout for SIG/WG pages to display metadata and GitHub links.
*   Improve accessibility with better ARIA labels in the filter bar.
*   Enhance mobile UX by removing hidden scrollbars and externalizing JavaScript.
* Remove redundant ignores from .gitignore and community/.gitignore
* Move canonical link and script to head-end.html hook
* Use generic .active class for topic tags with SCSS styles
* Extract master branch variable to reduce hardcoding
* Add caching support and optional token for resources.GetRemote
* Rename show_only wg to wgs for consistency
@TineoC
Copy link
Copy Markdown
Contributor Author

TineoC commented Mar 23, 2026

@lmktfy Do you want to add the token before merging these changes?

If so, I would set a hold, and please tag anyone who could help with this.

TineoC added 3 commits March 23, 2026 18:34
* Update content adapter to fetch READMEs and Charters with caching.
* Update community layout to prioritize embedded content.
* Add navigation link to Charter sub-page if generated.
@lmktfy
Copy link
Copy Markdown
Member

lmktfy commented Mar 24, 2026

add the token before merging these changes?

Not needed IMO. It's worth you knowing that we could, but it isn't required.

What happens with the build if the GET returns 429? We should (again, my opinion) aim to fail the whole build rather than publish a partial site.

@TineoC
Copy link
Copy Markdown
Contributor Author

TineoC commented Mar 25, 2026

add the token before merging these changes?

Not needed IMO. It's worth you knowing that we could, but it isn't required.

What happens with the build if the GET returns 429? We should (again, my opinion) aim to fail the whole build rather than publish a partial site.

Right, I added errorf messages for production builds: https://github.com/kubernetes/contributor-site/pull/654/changes#diff-4594c6ea8b73a548774d8feb96dee29fd26ded589ccc9f654b3b4bc8b5b4647dR19

Copy link
Copy Markdown
Member

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right if I load the deploy preview on a mobile phone like device, landscape.

But! there is an easy work around: hold it portrait.
We should fix the cosmetic bug but at this point, this LGTM

/lgtm
@kubernetes/sig-contributor-experience-pr-reviews happy to approve?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 25, 2026
@lmktfy
Copy link
Copy Markdown
Member

lmktfy commented Mar 25, 2026

/label tide/merge-method-squash

due to relatively high commit count

@lmktfy
Copy link
Copy Markdown
Member

lmktfy commented Mar 27, 2026

To me, this is a better commit message:
/retitle Render community groups info using content adapter

@k8s-ci-robot k8s-ci-robot changed the title feat(sigs): dynamic grid layout and content adapters modernization Render community groups info using content adapter Mar 27, 2026
@lmktfy
Copy link
Copy Markdown
Member

lmktfy commented Mar 27, 2026

/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lmktfy, TineoC

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 27, 2026
@k8s-ci-robot k8s-ci-robot merged commit dd31ec2 into kubernetes:master Mar 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants