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
44 changes: 44 additions & 0 deletions assets/scss/_styles_project.scss
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;
}
}
72 changes: 72 additions & 0 deletions content/en/resources/keps/_content.gotmpl
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 -}}
2 changes: 1 addition & 1 deletion content/en/resources/keps/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ linktitle: Enhancements
title: Kubernetes Enhancement Proposals (KEPs)
description: |
List of Kubernetes enhancements
type: docs
type: keps
---

These data come from the [kubernetes/enhancements]
Expand Down
32 changes: 32 additions & 0 deletions layouts/keps/baseof.html
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>
23 changes: 23 additions & 0 deletions layouts/keps/list.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 -}}
170 changes: 170 additions & 0 deletions layouts/keps/single.html
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 }}
Comment on lines +5 to +10
Copy link
Member

Choose a reason for hiding this comment

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

Nice approach.


{{/* 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>
Copy link
Member

Choose a reason for hiding this comment

The 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">
Copy link
Member

Choose a reason for hiding this comment

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

(nit)

Suggested change
<a href="https://features.k8s.io/{{ .Params.kepNumber }}" target="_blank" rel="noopener">
<a href="https://kep.k8s.io/{{ .Params.kepNumber }}" target="_blank" rel="noopener">

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>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<strong>Owning SIG:</strong>
<p class="kep-sigs-owner">Owning SIG:</p>

Copy link
Member

Choose a reason for hiding this comment

The 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 }}
Copy link
Member

Choose a reason for hiding this comment

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

(nit)

Suggested change
{{ strings.TrimPrefix "sig-" $sig | humanize | title }}
SIG {{ strings.TrimPrefix "sig-" $sig | humanize | title }}

</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
Copy link
Member

Choose a reason for hiding this comment

The 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 }}
Copy link
Member

Choose a reason for hiding this comment

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

<div class="kep-feature-gates mt-4">
<h2>Feature Gates</h2>
Copy link
Member

Choose a reason for hiding this comment

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

(nit)

Suggested change
<h2>Feature Gates</h2>
<h2>Feature Gates</h2>
<p>This enhancement was designed with opt-in or opt-out at the feature level;
there are <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/">feature gates</a> associated with it.</p>

<table class="table table-sm">
<thead>
Copy link
Member

Choose a reason for hiding this comment

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

Extra credit: add a <caption>.

<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
Copy link
Member

Choose a reason for hiding this comment

The 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>
Copy link
Member

Choose a reason for hiding this comment

The 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
Copy link
Member

Choose a reason for hiding this comment

The 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 seeAlso attribute point to the k/enhancements repo. Some refer to external sites or other repositories, and the current logic always renders them to the k/enhancements path, which results in 404 links. I have included a few examples below (Refer the Related KEPs section)

Copy link
Member

Choose a reason for hiding this comment

The 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 }}
Loading