-
Notifications
You must be signed in to change notification settings - Fork 175
Render a Page About Each KEP #618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a0a1eba
3927b48
99e8246
6865886
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,47 @@ | ||
| .navbar-brand__name { | ||
| text-transform: uppercase; | ||
| } | ||
|
|
||
| /* KEP page styles */ | ||
| .kep-page { | ||
| .kep-stage-badge { | ||
| margin-bottom: 1rem; | ||
|
|
||
| .badge { | ||
| font-size: 0.9rem; | ||
| padding: 0.5em 1em; | ||
| border-radius: 4px; | ||
| } | ||
| } | ||
|
|
||
| .kep-stage-alpha .badge { | ||
| background-color: #ffc107; | ||
| color: #000; | ||
| } | ||
|
|
||
| .kep-stage-beta .badge { | ||
| background-color: #17a2b8; | ||
| color: #fff; | ||
| } | ||
|
|
||
| .kep-stage-stable .badge { | ||
| background-color: #28a745; | ||
| color: #fff; | ||
| } | ||
|
|
||
| .kep-stage-deprecated .badge { | ||
| background-color: #6c757d; | ||
| color: #fff; | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 1.3rem; | ||
| border-bottom: 1px solid #dee2e6; | ||
| padding-bottom: 0.5rem; | ||
| margin-top: 1.5rem; | ||
| } | ||
|
|
||
| .table { | ||
| max-width: 600px; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| {{- $kepDataSourceUrl := "https://storage.googleapis.com/k8s-keps/keps.json" -}} | ||
| {{- $kepData := slice -}} | ||
|
|
||
| {{/* Fetch remote KEP data */}} | ||
| {{- with resources.GetRemote $kepDataSourceUrl -}} | ||
| {{- with .Err -}} | ||
| {{- if eq hugo.Environment "production" -}} | ||
| {{- errorf "Unable to load KEP data: %s" . -}} | ||
| {{- else -}} | ||
| {{- warnf "Cannot load KEP data: %s" . -}} | ||
| {{- end -}} | ||
| {{- else -}} | ||
| {{- $kepData = .Content | transform.Unmarshal -}} | ||
| {{- end -}} | ||
| {{- else -}} | ||
| {{- if eq hugo.Environment "production" -}} | ||
| {{- errorf "Unable to load KEP data from %s" $kepDataSourceUrl -}} | ||
| {{- else -}} | ||
| {{- warnf "Cannot load KEP data from %s" $kepDataSourceUrl -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* Define stages that are "beyond provisional" */}} | ||
| {{- $validStages := slice "alpha" "beta" "stable" "deprecated" -}} | ||
| {{- $validStatuses := slice "implementable" "implemented" -}} | ||
|
|
||
| {{/* Generate pages for each valid KEP */}} | ||
| {{- range $kep := $kepData -}} | ||
| {{/* Filter: only include KEPs beyond provisional */}} | ||
| {{- $isValidStage := in $validStages $kep.stage -}} | ||
| {{- $isValidStatus := in $validStatuses $kep.status -}} | ||
|
|
||
| {{- if or $isValidStage $isValidStatus -}} | ||
| {{/* Build page params with all KEP metadata */}} | ||
| {{- $params := dict | ||
| "kepNumber" $kep.kepNumber | ||
| "name" $kep.name | ||
| "stage" $kep.stage | ||
| "status" $kep.status | ||
| "owningSig" $kep.owningSig | ||
| "participatingSigs" $kep.participatingSigs | ||
| "authors" $kep.authors | ||
| "reviewers" $kep.reviewers | ||
| "approvers" $kep.approvers | ||
| "creationDate" $kep.creationDate | ||
| "lastUpdated" $kep.lastUpdated | ||
| "latestMilestone" $kep.latestMilestone | ||
| "milestone" $kep.milestone | ||
| "featureGates" $kep.featureGates | ||
| "disableSupported" $kep.disableSupported | ||
| "seeAlso" $kep.seeAlso | ||
| "replaces" $kep.replaces | ||
| "supersededBy" $kep.supersededBy | ||
| "metrics" $kep.metrics | ||
| "toc_hide" true | ||
| -}} | ||
|
|
||
| {{/* Build page path: /resources/keps/{kepNumber}/ */}} | ||
| {{- $pagePath := $kep.kepNumber -}} | ||
|
|
||
| {{/* Create page dict */}} | ||
| {{- $page := dict | ||
| "path" $pagePath | ||
| "title" $kep.title | ||
| "kind" "page" | ||
| "type" "keps" | ||
| "params" $params | ||
| -}} | ||
|
|
||
| {{- $.AddPage $page -}} | ||
| {{- end -}} | ||
| {{- end -}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <!doctype html> | ||
| <html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.Language.Lang }}" class="no-js"> | ||
| <head> | ||
| {{ partial "head.html" . }} | ||
| </head> | ||
| <body class="td-{{ .Kind }}{{ with .Page.Params.body_class }} {{ . }}{{ end }}"> | ||
| <header> | ||
| {{ partial "navbar.html" . }} | ||
| </header> | ||
| <div class="container-fluid td-outer"> | ||
| <div class="td-main"> | ||
| <div class="row flex-xl-nowrap"> | ||
| <aside class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none"> | ||
| {{ partial "sidebar.html" . }} | ||
| </aside> | ||
| <aside class="d-none d-xl-block col-xl-2 td-sidebar-toc d-print-none"> | ||
| {{ partial "page-meta-links.html" . }} | ||
| {{ partial "toc.html" . }} | ||
| {{ partial "taxonomy_terms_clouds.html" . }} | ||
| </aside> | ||
| <main class="col-12 col-md-9 col-xl-8 ps-md-5" role="main"> | ||
| {{ partial "version-banner.html" . }} | ||
| {{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }} | ||
| {{ block "main" . }}{{ end }} | ||
| </main> | ||
| </div> | ||
| </div> | ||
| {{ partial "footer.html" . }} | ||
| </div> | ||
| {{ partial "scripts.html" . }} | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| {{ define "main" }} | ||
| <div class="td-content"> | ||
| <h1>{{ .Title }}</h1> | ||
| {{ with .Params.description }}<div class="lead">{{ . | markdownify }}</div>{{ end }} | ||
| <header class="article-meta"> | ||
| {{ partial "taxonomy_terms_article_wrapper.html" . -}} | ||
| {{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) -}} | ||
| {{ partial "reading-time.html" . -}} | ||
| {{ end -}} | ||
| </header> | ||
| {{ .Content }} | ||
| {{/* Intentionally omit section-index.html to avoid listing all KEP pages */}} | ||
| {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.Config.Services.GoogleAnalytics.ID)) -}} | ||
| {{ partial "feedback.html" .Site.Params.ui.feedback -}} | ||
| <br /> | ||
| {{ end -}} | ||
| {{ if (.Site.Config.Services.Disqus.Shortname) -}} | ||
| <br /> | ||
| {{- partial "disqus-comment.html" . -}} | ||
| {{ end -}} | ||
| {{ partial "page-meta-lastmod.html" . -}} | ||
| </div> | ||
| {{ end -}} |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,170 @@ | ||||||||||
| {{ define "main" }} | ||||||||||
| <div class="td-content kep-page"> | ||||||||||
| <h1>KEP-{{ .Params.kepNumber }}: {{ .Title }}</h1> | ||||||||||
|
|
||||||||||
| {{/* Stage badge */}} | ||||||||||
| {{ with .Params.stage }} | ||||||||||
| <div class="kep-stage-badge kep-stage-{{ . }}"> | ||||||||||
| <span class="badge">{{ . | upper }}</span> | ||||||||||
| </div> | ||||||||||
| {{ end }} | ||||||||||
|
|
||||||||||
| {{/* Status info */}} | ||||||||||
| {{ with .Params.status }} | ||||||||||
| <p class="kep-status"><strong>Status:</strong> {{ . | humanize | title }}</p> | ||||||||||
| {{ end }} | ||||||||||
|
|
||||||||||
| {{/* External links section */}} | ||||||||||
| <div class="kep-links mt-4"> | ||||||||||
| <h2>Links</h2> | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we consider making these headings linkable by adding anchor links to them? |
||||||||||
| <ul> | ||||||||||
| <li> | ||||||||||
| <a href="https://features.k8s.io/{{ .Params.kepNumber }}" target="_blank" rel="noopener"> | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (nit)
Suggested change
|
||||||||||
| Enhancement Issue #{{ .Params.kepNumber }} | ||||||||||
| </a> | ||||||||||
| </li> | ||||||||||
| <li> | ||||||||||
| <a href="https://github.com/kubernetes/enhancements/tree/master/keps/{{ .Params.owningSig }}/{{ .Params.name }}" target="_blank" rel="noopener"> | ||||||||||
| KEP Documentation | ||||||||||
| </a> | ||||||||||
| </li> | ||||||||||
| </ul> | ||||||||||
| </div> | ||||||||||
|
|
||||||||||
| {{/* SIG information */}} | ||||||||||
| <div class="kep-sigs mt-4"> | ||||||||||
| <h2>SIGs</h2> | ||||||||||
| <p> | ||||||||||
| <strong>Owning SIG:</strong> | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (and then add an associated stylesheet entry) |
||||||||||
| <a href="https://github.com/kubernetes/community/tree/master/{{ .Params.owningSig }}"> | ||||||||||
| {{ strings.TrimPrefix "sig-" .Params.owningSig | humanize | title }} | ||||||||||
| </a> | ||||||||||
| </p> | ||||||||||
| {{ with .Params.participatingSigs }} | ||||||||||
| <p> | ||||||||||
| <strong>Participating SIGs:</strong> | ||||||||||
| {{ range $i, $sig := . }} | ||||||||||
| {{- if $i }}, {{ end -}} | ||||||||||
| <a href="https://github.com/kubernetes/community/tree/master/{{ $sig }}"> | ||||||||||
| {{ strings.TrimPrefix "sig-" $sig | humanize | title }} | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (nit)
Suggested change
|
||||||||||
| </a> | ||||||||||
| {{ end }} | ||||||||||
| </p> | ||||||||||
| {{ end }} | ||||||||||
| </div> | ||||||||||
|
|
||||||||||
| {{/* Milestone information */}} | ||||||||||
| {{ with .Params.milestone }} | ||||||||||
| <div class="kep-milestones mt-4"> | ||||||||||
| <h2>Milestones</h2> | ||||||||||
| <table class="table table-sm"> | ||||||||||
| <tbody> | ||||||||||
| {{ with .alpha }}<tr><td>Alpha</td><td>{{ . }}</td></tr>{{ end }} | ||||||||||
| {{ with .beta }}<tr><td>Beta</td><td>{{ . }}</td></tr>{{ end }} | ||||||||||
| {{ with .stable }}<tr><td>Stable</td><td>{{ . }}</td></tr>{{ end }} | ||||||||||
| {{ with .deprecated }}<tr><td>Deprecated</td><td>{{ . }}</td></tr>{{ end }} | ||||||||||
|
Comment on lines
+62
to
+65
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we use special marking to show that future milestones are anticipated, rather than commitments. |
||||||||||
| </tbody> | ||||||||||
| </table> | ||||||||||
| </div> | ||||||||||
| {{ end }} | ||||||||||
|
|
||||||||||
| {{/* Feature gates */}} | ||||||||||
| {{ with .Params.featureGates }} | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can maybe one day link to https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#NameGoesHere (or whatever) Also the Kubernetes website people can - if asked - set up short URLs if we want, eg https://features.k8s.io/gates/NameGoesHere that redirects to https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#NameGoesHere |
||||||||||
| <div class="kep-feature-gates mt-4"> | ||||||||||
| <h2>Feature Gates</h2> | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (nit)
Suggested change
|
||||||||||
| <table class="table table-sm"> | ||||||||||
| <thead> | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra credit: add a |
||||||||||
| <tr> | ||||||||||
| <th>Name</th> | ||||||||||
| <th>Components</th> | ||||||||||
| </tr> | ||||||||||
| </thead> | ||||||||||
| <tbody> | ||||||||||
| {{ range . }} | ||||||||||
| <tr> | ||||||||||
| <td><code>{{ .name }}</code></td> | ||||||||||
| <td> | ||||||||||
| {{ range $i, $comp := .components }} | ||||||||||
| {{- if $i }}, {{ end -}} | ||||||||||
| <code>{{ $comp }}</code> | ||||||||||
| {{ end }} | ||||||||||
| </td> | ||||||||||
| </tr> | ||||||||||
| {{ end }} | ||||||||||
| </tbody> | ||||||||||
| </table> | ||||||||||
| </div> | ||||||||||
| {{ end }} | ||||||||||
|
|
||||||||||
| {{/* Authors and contributors */}} | ||||||||||
| <div class="kep-people mt-4"> | ||||||||||
| <h2>People</h2> | ||||||||||
|
|
||||||||||
| {{ with .Params.authors }} | ||||||||||
| <p> | ||||||||||
| <strong>Authors:</strong> | ||||||||||
| {{ range $i, $author := . }} | ||||||||||
| {{- if $i }}, {{ end -}} | ||||||||||
| <a href="https://github.com/{{ trim $author "@" }}">{{ $author }}</a> | ||||||||||
| {{ end }} | ||||||||||
| </p> | ||||||||||
| {{ end }} | ||||||||||
|
|
||||||||||
| {{ with .Params.approvers }} | ||||||||||
| <p> | ||||||||||
| <strong>Approvers:</strong> | ||||||||||
| {{ range $i, $approver := . }} | ||||||||||
| {{- if $i }}, {{ end -}} | ||||||||||
| <a href="https://github.com/{{ trim $approver "@" }}">{{ $approver }}</a> | ||||||||||
| {{ end }} | ||||||||||
| </p> | ||||||||||
| {{ end }} | ||||||||||
|
Comment on lines
+113
to
+121
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: list these after reviewers |
||||||||||
|
|
||||||||||
| {{ with .Params.reviewers }} | ||||||||||
| <p> | ||||||||||
| <strong>Reviewers:</strong> | ||||||||||
| {{ range $i, $reviewer := . }} | ||||||||||
| {{- if $i }}, {{ end -}} | ||||||||||
| <a href="https://github.com/{{ trim $reviewer "@" }}">{{ $reviewer }}</a> | ||||||||||
| {{ end }} | ||||||||||
| </p> | ||||||||||
| {{ end }} | ||||||||||
| </div> | ||||||||||
|
|
||||||||||
| {{/* Dates */}} | ||||||||||
| <div class="kep-dates mt-4"> | ||||||||||
| <h2>Timeline</h2> | ||||||||||
| {{ with .Params.creationDate }} | ||||||||||
| <p><strong>Created:</strong> <time datetime="{{ . }}">{{ . }}</time></p> | ||||||||||
| {{ end }} | ||||||||||
| {{ with .Params.lastUpdated }} | ||||||||||
| <p><strong>Last Updated:</strong> <time datetime="{{ . }}">{{ . }}</time></p> | ||||||||||
| {{ end }} | ||||||||||
| {{ with $.Params.latestMilestone }} | ||||||||||
| <p><strong>Latest Milestone:</strong> {{ . }}</p> | ||||||||||
| {{ end }} | ||||||||||
| </div> | ||||||||||
|
|
||||||||||
| {{/* See Also */}} | ||||||||||
| {{ with .Params.seeAlso }} | ||||||||||
| <div class="kep-see-also mt-4"> | ||||||||||
| <h2>Related KEPs</h2> | ||||||||||
| <ul> | ||||||||||
| {{ range . }} | ||||||||||
| <li> | ||||||||||
| <a href="https://github.com/kubernetes/enhancements/tree/master{{ . }}">{{ . }}</a> | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we could link to the generated page for the related KEP? |
||||||||||
| </li> | ||||||||||
| {{ end }} | ||||||||||
|
Comment on lines
+149
to
+157
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block generation logic may need a small tweak, because not all links in the KEP JSON
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mmm, yes, let's avoid making an assumption about what this field is set to. |
||||||||||
| </ul> | ||||||||||
| </div> | ||||||||||
| {{ end }} | ||||||||||
|
|
||||||||||
| {{/* Manual content placeholder - for markdown overrides */}} | ||||||||||
| {{ if .Content }} | ||||||||||
| <div class="kep-custom-content mt-4"> | ||||||||||
| {{ .Content }} | ||||||||||
| </div> | ||||||||||
| {{ end }} | ||||||||||
|
|
||||||||||
| </div> | ||||||||||
| {{ end }} | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice approach.