Skip to content

Index table re-derives the generator's publish rule, so the two can silently disagree #850

Description

@TineoC

Problem

Two templates independently decide which KEPs are publishable, using two copies of the same rule (stage in alpha/beta/stable/deprecated or status in implementable/implemented).

  • content/en/resources/keps/_content.gotmpl uses it to decide whether to AddPage.
  • layouts/shortcodes/keps-data.html uses its own copy ($hasPage) to decide whether a row links to /resources/keps/N/ or falls back to features.k8s.io/N.

$hasPage never checks that the page exists — it predicts what the generator did by re-deriving the same rule.

Suggested fix

One partial owning the rule, both callers reading it:

{{/* layouts/partials/kep-data.html — returns the filtered KEP slice */}}
{{- $out := slice -}}
{{- range $kep := $kepData -}}
  {{- if or (in $validStages $kep.stage) (in $validStatuses $kep.status) -}}
    {{- $out = $out | append $kep -}}
  {{- end -}}
{{- end -}}
{{- return $out -}}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions