mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
chore: summary bar cleanup (#21887)
## Description - Updated "Contribute" guide to reference summary bars, added instructions for using them - Removed `introduced` partial, this is now replaced by the summary bar `requires` value - Updated all files using `introduced` partial to use summary bar, updated YAML file w/ feature name and info ## Related issues or tickets [ENGDOCS-2392](https://docker.atlassian.net/browse/ENGDOCS-2392) ## Reviews - [ ] Technical review - [ ] Editorial review [ENGDOCS-2392]: https://docker.atlassian.net/browse/ENGDOCS-2392?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
{{- /*
|
||||
Renders a version callout for when a feature was introduced in a component.
|
||||
|
||||
Accepts positional parameters.
|
||||
Depends on site.Params.min_version_thresholds and i18n strings for component IDs
|
||||
|
||||
@param {string} component The ID of the component as defined in site config.
|
||||
@param {string} version The version of the component in which the thing was introduced.
|
||||
@param {string} [link] A relevant link to e.g. release note.
|
||||
|
||||
@returns {template.HTML}
|
||||
|
||||
@examples
|
||||
|
||||
{{< introduced buildx 0.12.0 "../release-notes.md#0120" >}}
|
||||
|
||||
{{< introduced desktop "4.28" "https://example.com/" >}}
|
||||
|
||||
*/ -}}
|
||||
|
||||
{{- $component := .Get 0 }}
|
||||
{{- $v := .Get 1 }}
|
||||
{{- $link := .Get 2 }}
|
||||
{{- $pos := .Position }}
|
||||
{{- with (index site.Params.min_version_thresholds $component) }}
|
||||
{{- /*
|
||||
Hacky semver comparison.
|
||||
|
||||
- Split the input version and threshold version strings
|
||||
- Range over the input version []string
|
||||
- Cast to ints and compare input with same index threshold []string
|
||||
- Set threshold false if input is lower than config, and break
|
||||
*/ -}}
|
||||
{{ $vslice := strings.Split $v "." }}
|
||||
{{ $tslice := strings.Split . "." }}
|
||||
{{ $versionAboveThreshold := true }}
|
||||
{{ range $i, $e := $vslice }}
|
||||
{{ if compare.Lt (cast.ToInt $e) (cast.ToInt (index $tslice $i)) }}
|
||||
{{ $versionAboveThreshold = false }}
|
||||
{{ break }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- if $versionAboveThreshold }}
|
||||
<div class="text-gray-light dark:text-gray-dark flex items-center gap-2">
|
||||
<span class="icon-svg flex items-center">{{ partialCached "icon.html" "chevron_right" "chevron_right" }}</span>
|
||||
<span>Introduced in {{ T $component }} version
|
||||
{{- if $link }}
|
||||
{{ page.RenderString (fmt.Printf `[%s](%s)` $v $link) }}
|
||||
{{- else }}
|
||||
{{ $v }}
|
||||
{{- end }}
|
||||
</span>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{ errorf "[introduced] invalid component: %s %v" $component $pos }}
|
||||
{{- end }}
|
||||
@@ -57,7 +57,7 @@
|
||||
{{ with $feature.requires }}
|
||||
<div class="flex items-center gap-1">
|
||||
<span class="font-bold">Requires:</span>
|
||||
<span>{{ . }}</span>
|
||||
<span>{{ . | markdownify }}</span>
|
||||
<span class="icon-svg">
|
||||
{{ partial "icon" $requiresIcon }}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user